Skip to content

net: clarify platform-dependent backlog in TcpSocket docs#7738

Merged
ADD-SP merged 1 commit intotokio-rs:masterfrom
seakerOner:tcpsocket-doc-fix
Nov 16, 2025
Merged

net: clarify platform-dependent backlog in TcpSocket docs#7738
ADD-SP merged 1 commit intotokio-rs:masterfrom
seakerOner:tcpsocket-doc-fix

Conversation

@seakerOner
Copy link
Contributor

Fixes: #7729

Motivation

The documentation example for reproducing the behavior of TcpListener::bind uses a hardcoded backlog value of 1024. However, Tokio now relies on Mio's platform-dependent default backlog configuration, so the value in the example was misleading.

Solution

This commit updates the documentation by adding a note explaining that the
actual backlog used by TcpListener::bind varies by platform and that the
example value is only illustrative.

The example showing how `TcpListener::bind` is equivalent to manually
constructing a `TcpSocket` previously used a hardcoded backlog of 1024.
However, Tokio now relies on Mio's platform-dependent default backlog
configuration, so the value in the example was misleading.

This commit updates the documentation by adding a note explaining that
the
actual backlog used by `TcpListener::bind` varies by platform and that
the
example value is only illustrative.

Fixes: tokio-rs#7729
@ADD-SP
Copy link
Member

ADD-SP commented Nov 16, 2025

Thanks!

@ADD-SP ADD-SP added T-docs Topic: documentation A-tokio Area: The main tokio crate M-net Module: tokio/net labels Nov 16, 2025
@ADD-SP ADD-SP merged commit 4714ca1 into tokio-rs:master Nov 16, 2025
98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tokio Area: The main tokio crate M-net Module: tokio/net T-docs Topic: documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TcpListener::bind example in TcpSocket docs is no longer correct

2 participants