Skip to content

Fix/improve comments for LISTEN_BACKLOG_SIZE - #1915

Merged
Thomasdezeeuw merged 1 commit into
tokio-rs:masterfrom
opara-tor:master
Feb 24, 2026
Merged

Fix/improve comments for LISTEN_BACKLOG_SIZE#1915
Thomasdezeeuw merged 1 commit into
tokio-rs:masterfrom
opara-tor:master

Conversation

@opara-tor

@opara-tor opara-tor commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

The backlog size logic that was copied from the standard library was for unix sockets, not inet sockets. Mio's backlog sizes differ greatly from the standard library for inet sockets (128 or smaller). The comments here were confusing/misleading, so I've tried to clarify them.

@Thomasdezeeuw

Thomasdezeeuw commented Nov 13, 2025

Copy link
Copy Markdown
Collaborator

Reading https://github.com/rust-lang/rust/blob/4f808ba6bf9f1c8dde30d009e73386d984491587/library/std/src/sys/net/connection/socket.rs#L538-L541 now, these values might be wrong. Might have to revert #1896 or split TCP from Unix values.

@opara-tor

Copy link
Copy Markdown
Contributor Author

I think having separate TCP and unix backlogs would be best. For TCP, I think sticking with the old value of 1024 makes sense to avoid breaking existing users, but maybe the special cases for horizon and haiku could be added.

Should I close this and open an issue instead?

@Thomasdezeeuw Thomasdezeeuw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Going to merge this and send a follow pr to change the values. Thanks @opara-tor

@Thomasdezeeuw
Thomasdezeeuw merged commit 9a387a5 into tokio-rs:master Feb 24, 2026
58 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants