std::net: TcpListener shrinks the backlog argument to 32 for Haiku.

This commit is contained in:
David Carlier 2024-04-12 16:41:29 +01:00
parent 7bdae134cb
commit 1ce559b690
No known key found for this signature in database
GPG Key ID: D308BD11AB42D054

View File

@ -417,6 +417,10 @@ impl TcpListener {
// it allows up to about 37, but other times it doesn't even
// accept 32. There may be a global limitation causing this.
let backlog = 20;
} else if #[cfg(target_os = "haiku")] {
// Haiku does not support a queue length > 32
// https://github.com/haiku/haiku/blob/979a0bc487864675517fb2fab28f87dc8bf43041/headers/posix/sys/socket.h#L81
let backlog = 32;
} else {
// The default for all other platforms
let backlog = 128;