-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Closed as not planned
Copy link
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
In socket-style network interfaces, the server side typically requests a "backlog" from the operating system. This controls how many requests the OS is willing to buffer before failing or ignoring new requests.
The backlogs used by std::net::TcpListener::bind
, std::os::unix::net::UnixListener::bind
and the nightly std::os::unix::net::UnixListener::bind_addr
are currently hardwired to 128. This is a reasonable default, but there are situations where one might want to set a larger or smaller number. Also, that 128 default should probably be a publicly-exposed constant.
To address these issues I have posted a PR that provides the following new APIs:
std::net::TcpListener::DEFAULT_BACKLOG
std::net::TcpListener::bind_with_backlog
std::os::unix::net::UnixListener::DEFAULT_BACKLOG
std::os::unix::net::UnixListener::bind_with_backlog
std::os::unix::net::UnixListener::bind_addr_with_backlog
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.