std::net: bind update for using backlog as -1
too.
Albeit not documented, macOs also support negative value for the backlog
argument.
ref: 2ff845c2e0/bsd/kern/uipc_socket.c (L1061)
This commit is contained in:
parent
9567c3ee73
commit
89cf17777b
1 changed files with 7 additions and 1 deletions
|
@ -80,7 +80,12 @@ impl UnixListener {
|
|||
target_os = "horizon"
|
||||
))]
|
||||
const backlog: libc::c_int = 128;
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "freebsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "macos"
|
||||
))]
|
||||
const backlog: libc::c_int = -1;
|
||||
#[cfg(not(any(
|
||||
target_os = "windows",
|
||||
|
@ -88,6 +93,7 @@ impl UnixListener {
|
|||
target_os = "linux",
|
||||
target_os = "freebsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "macos",
|
||||
target_os = "espidf",
|
||||
target_os = "horizon"
|
||||
)))]
|
||||
|
|
Loading…
Add table
Reference in a new issue