Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
stephen-hansen wants to merge3 commits intopython:main
base:main
Choose a base branch
Loading
fromstephen-hansen:docs-socketserver-missing-attributes

Conversation

stephen-hansen
Copy link
Contributor

@stephen-hansenstephen-hansen commentedDec 28, 2024
edited by github-actionsbot
Loading

Just doing some cleanup of the socketserver docs regarding class attributes as mentioned in the linked issue.

  • Moveaddress_family attribute from instance attributes to class attributes.
  • Documentallow_reuse_port.
  • Documentmax_packet_size (note UDP only).
  • Add note torequest_queue_size to denote TCP only.

📚 Documentation preview 📚:https://cpython-previews--128320.org.readthedocs.build/

Copy link
Member

@ZeroIntensityZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for doing this :)

stephen-hansenand others added2 commitsDecember 29, 2024 11:32
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Copy link

@reactive-firewallreactive-firewall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍🏻 LGTM! With conditions (see knit-picky inline comment)

🙇 Thanks@stephen-hansen; These document drafts have already been useful to me.

stephen-hansen reacted with thumbs up emoji
Comment on lines +311 to +314
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.

Choose a reason for hiding this comment

The 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
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.
The maximum amount of data (in bytes) to receive at once. If a packet's
payload (excluding headers) istoo large for the buffer, then the excess
bytes beyond:attr:`max_packet_size`are discarded. The default value
is usually ``8192``, but this can beoverridden by subclasses.

or if this really is the literal maximum packet size:

Suggested change
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.
The maximum amount of data (in bytes) to receive at once. If a packet's
payload (including headers) istoo large for the buffer, then the excess
bytes beyond:attr:`max_packet_size`are discarded. The default value
is usually ``8192``, but this can beoverridden by subclasses.

Rational:
Omission of any mention of header when talking about a "packet" being "too large" is somewhat misleading to the reader.
not sure if going further is relevant to the python side, but for convenience sake I'll mention, the typical 20-byte IPV4 header (RFC-791 gives 20-byte base header, 40-byte maximum options) and the required 8-byte header assuming UDP (RFC-768).

Hopefully this helps.


Additional considerations (TL;DR):

  • MTU, and fragmentation boundaries are possible reasons to want to change the default (eg. expected max burst count * max packet size (including headers) on network path with values of5 * (1500 - 20 - 40 - 8) =7160 so the default is somewhat larger than the similar stream sockets'request_queue_size default)
  • UDP max packet size (after headers) is a possible (albeit unlikely) reason for increasing the size well beyond the default of8192

stephen-hansen reacted with thumbs up emoji
@hugovkhugovk removed the needs backport to 3.12only security fixes labelApr 10, 2025
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@picnixzpicnixzpicnixz left review comments

@reactive-firewallreactive-firewallreactive-firewall left review comments

@ZeroIntensityZeroIntensityZeroIntensity left review comments

Assignees
No one assigned
Labels
awaiting reviewdocsDocumentation in the Doc dirneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixesskip news
Projects
Status: Todo
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@stephen-hansen@picnixz@reactive-firewall@ZeroIntensity@hugovk@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp