-
Notifications
You must be signed in to change notification settings - Fork 13.3k
std::net: adding tcp_syncnt feature for Linux/Android. #123111
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
Conversation
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
/// The maximum valid value is 255. | ||
/// | ||
/// See [`man 7 tcp`](https://man7.org/linux/man-pages/man7/tcp.7.html) | ||
/// | ||
/// # Examples | ||
/// | ||
/// ```no_run | ||
/// #![feature(tcp_syncnt)] | ||
/// use std::net::TcpStream; | ||
/// use std::os::linux::net::TcpStreamExt; | ||
/// | ||
/// let stream = TcpStream::connect("127.0.0.1:8080") | ||
/// .expect("Couldn't connect to the server..."); | ||
/// stream.set_syncnt(3).expect("set_setcnt call failed"); | ||
#[unstable(feature = "tcp_syncnt", issue = "123112")] | ||
fn set_syncnt(&self, count: u32) -> io::Result<()>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity - could the count parameter just be a u8 since the docs state a maximum valid value of 255 (or is it expected that this maximum might rise in the future)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it definitively can be u8.
to control the number of client's attempts to establish a connection.
The implementation looks fine but adding APIs should probably have some libs-api oversight. So choosing a libs-api member at random... r? joshtriplett |
By the time you have a TcpStream, you already have a connection established, so this may not be effective. We don't have a mechanism for options on unbound sockets. We should, but we don't. (Developing that is a much larger-scale problem.) |
@rustbot autho |
Oh I forgot this one. Well I guess this is the same issue as here. |
to control the number of client's attempts to establish a connection.