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

std::net: adding tcp_syncnt feature for Linux/Android. #123111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devnexen
Copy link
Contributor

to control the number of client's attempts to establish a connection.

@rustbot
Copy link
Collaborator

rustbot commented Mar 26, 2024

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 26, 2024
@devnexen devnexen marked this pull request as ready for review March 26, 2024 22:50
Comment on lines 107 to 122
/// 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<()>;
Copy link
Contributor

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)?

Copy link
Contributor Author

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.
@ChrisDenton ChrisDenton added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 27, 2024
@ChrisDenton
Copy link
Contributor

The implementation looks fine but adding APIs should probably have some libs-api oversight. So choosing a libs-api member at random...

r? joshtriplett

@rustbot rustbot assigned joshtriplett and unassigned ChrisDenton Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants