Skip to content
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

docs: discarded server TCP connection config #1473

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

domodwyer
Copy link
Contributor

Some methods on the Router utilise the TCP configuration of the Server, and others don't.

It's fairly obvious why when looking at the generic bounds, but we were using serve_with_incoming() with a TcpListenerStream (which seems to be not uncommon) and the author hadn't made the mental leap that this would cause TCP_NODELAY to be disabled / default discarded.

I nearly didn't open this, because it's somewhat obvious in hindsight, but a small docs tweak might save some others a bit of confusion.

Solution

Update the docs. Maybe it needs a comment on the Server's tcp_keepalive() and tcp_nodelay() methods instead?

domodwyer and others added 2 commits August 24, 2023 23:08
The Server type accepts TCP configuration parameters (keepalive &
TCP_NODELAY) which are only respected when using serve() or
serve_with_shutdown().

Serve methods that take a stream of AsyncRead + AsyncWrite are
necessarily unaware of the underlying transport, and therefore silently
discard any TCP specific configuration.
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Thank you! I always appreciate doc updates even if they are obvious, usually they are not always before they become obvious 😄

@LucioFranco LucioFranco added this pull request to the merge queue Aug 25, 2023
Merged via the queue into hyperium:master with commit fa0ffbb Aug 25, 2023
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