-
Couldn't load subscription status.
- Fork 13.9k
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_BACKLOGstd::net::TcpListener::bind_with_backlogstd::os::unix::net::UnixListener::DEFAULT_BACKLOGstd::os::unix::net::UnixListener::bind_with_backlogstd::os::unix::net::UnixListener::bind_addr_with_backlog