Skip to content

Conversation

@noam-sol
Copy link
Contributor

@noam-sol noam-sol commented Aug 11, 2025

Add a note like in std::net::TcpListener.

Motivation

I wasn't sure whether tokio TcpListener closes the connection on close, and had to look at the internals to figure out it just wraps a regular TcpListener. Also, I was using the crates warp->hyper and had to look all down the stack to see how the port is managed.

Solution

Added to the docs a note just like in std::net::TcpListener

Add a note like in std::net::TcpListener.
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-net Module: tokio/net T-docs Topic: documentation labels Aug 11, 2025
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

I would say it goes without saying that proper cleanup will happen, but I guess it doens't hurt to add to the docs.

@Darksonn Darksonn enabled auto-merge (squash) August 11, 2025 16:18
@Darksonn Darksonn merged commit 131afd3 into tokio-rs:master Aug 11, 2025
102 checks passed
@noam-sol
Copy link
Contributor Author

@Darksonn I guess so, but when comparing the docs with the std counterpart which states it explicitly, it got me thinking if I'm missing some special cleanup that I need to keep in mind (I'm also new to rust).

Thanks for the quick merge!

@Darksonn
Copy link
Contributor

Thanks for the PR!

@Darksonn Darksonn mentioned this pull request Oct 14, 2025
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.

2 participants