-
-
Couldn't load subscription status.
- Fork 33.2k
gh-128319: Add missing server class attributes to socketserver docs #128320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -264,12 +264,6 @@ Server Objects | |||||||||||||||||||||||||||||||||
| Clean up the server. May be overridden. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. attribute:: address_family | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| The family of protocols to which the server's socket belongs. | ||||||||||||||||||||||||||||||||||
| Common examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. attribute:: RequestHandlerClass | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| The user-provided request handler class; an instance of this class is created | ||||||||||||||||||||||||||||||||||
|
|
@@ -294,19 +288,47 @@ Server Objects | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. XXX should class variables be covered before instance variables, or vice versa? | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. attribute:: address_family | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| The family of protocols to which the server's socket belongs. | ||||||||||||||||||||||||||||||||||
| Common examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. attribute:: allow_reuse_address | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Whether the server will allow the reuse of an address. This defaults to | ||||||||||||||||||||||||||||||||||
| :const:`False`, and can be set in subclasses to change the policy. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. attribute:: allow_reuse_port | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Whether the server will allow the reuse of a port. This defaults to | ||||||||||||||||||||||||||||||||||
| :const:`False`, and can be set in subclasses to change the policy. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. attribute:: max_packet_size | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| The maximum amount of data (in bytes) to receive at once. If a packet is | ||||||||||||||||||||||||||||||||||
| too large for the buffer, then the excess bytes beyond :attr:`max_packet_size` | ||||||||||||||||||||||||||||||||||
| are discarded. The default value is usually ``8192``, but this can be | ||||||||||||||||||||||||||||||||||
| overridden by subclasses. | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+311
to
+314
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM! With conditions: Please consider clarifying if the term "data" here, means without IP/UDP headers with something like:
Suggested change
or if this really is the literal maximum packet size:
Suggested change
Rational: Hopefully this helps. Additional considerations (TL;DR):
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. note:: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Only for datagram sockets, i.e. UDP. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. attribute:: request_queue_size | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| The size of the request queue. If it takes a long time to process a single | ||||||||||||||||||||||||||||||||||
| request, any requests that arrive while the server is busy are placed into a | ||||||||||||||||||||||||||||||||||
| queue, up to :attr:`request_queue_size` requests. Once the queue is full, | ||||||||||||||||||||||||||||||||||
| further requests from clients will get a "Connection denied" error. The default | ||||||||||||||||||||||||||||||||||
| value is usually 5, but this can be overridden by subclasses. | ||||||||||||||||||||||||||||||||||
| value is usually ``5``, but this can be overridden by subclasses. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. note:: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Only for stream sockets, i.e. TCP. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| .. attribute:: socket_type | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.