@@ -98,42 +98,40 @@ cfg_not_os_poll! {
98
98
/// - Default values vary depending on the OS and its version. Common defaults
99
99
/// include: -1, 128, 1024, and 4096.
100
100
///
101
+ // Here is the original code from the standard library
102
+ // https://github.com/rust-lang/rust/blob/4f808ba6bf9f1c8dde30d009e73386d984491587/library/std/src/os/unix/net/listener.rs#L72
103
+ //
101
104
#[ allow( dead_code) ]
102
- pub ( crate ) const fn get_listen_backlog_size ( ) -> i32 {
103
- // Here is the original code from the standard library
104
- // https://github.com/rust-lang/rust/blob/4f808ba6bf9f1c8dde30d009e73386d984491587/library/std/src/os/unix/net/listener.rs#L72
105
- #[ cfg( any(
106
- target_os = "windows" ,
107
- target_os = "redox" ,
108
- target_os = "espidf" ,
109
- target_os = "horizon"
110
- ) ) ]
111
- const BACKLOG_SIZE : i32 = 128 ;
105
+ #[ cfg( any(
106
+ target_os = "windows" ,
107
+ target_os = "redox" ,
108
+ target_os = "espidf" ,
109
+ target_os = "horizon"
110
+ ) ) ]
111
+ pub ( crate ) const LISTEN_BACKLOG_SIZE : i32 = 128 ;
112
112
113
- #[ allow( dead_code) ]
114
- #[ cfg( any(
115
- // Silently capped to `/proc/sys/net/core/somaxconn`.
116
- target_os = "linux" ,
117
- // Silently capped to `kern.ipc.soacceptqueue`.
118
- target_os = "freebsd" ,
119
- // Silently capped to `kern.somaxconn sysctl`.
120
- target_os = "openbsd" ,
121
- // Silently capped to the default 128.
122
- target_vendor = "apple" ,
123
- ) ) ]
124
- const BACKLOG_SIZE : i32 = -1 ;
113
+ #[ allow( dead_code) ]
114
+ #[ cfg( any(
115
+ // Silently capped to `/proc/sys/net/core/somaxconn`.
116
+ target_os = "linux" ,
117
+ // Silently capped to `kern.ipc.soacceptqueue`.
118
+ target_os = "freebsd" ,
119
+ // Silently capped to `kern.somaxconn sysctl`.
120
+ target_os = "openbsd" ,
121
+ // Silently capped to the default 128.
122
+ target_vendor = "apple" ,
123
+ ) ) ]
124
+ pub ( crate ) const LISTEN_BACKLOG_SIZE : i32 = -1 ;
125
125
126
- #[ allow( dead_code) ]
127
- #[ cfg( not( any(
128
- target_os = "windows" ,
129
- target_os = "redox" ,
130
- target_os = "espidf" ,
131
- target_os = "horizon" ,
132
- target_os = "linux" ,
133
- target_os = "freebsd" ,
134
- target_os = "openbsd" ,
135
- target_vendor = "apple" ,
136
- ) ) ) ]
137
- const BACKLOG_SIZE : i32 = libc:: SOMAXCONN ;
138
- BACKLOG_SIZE
139
- }
126
+ #[ allow( dead_code) ]
127
+ #[ cfg( not( any(
128
+ target_os = "windows" ,
129
+ target_os = "redox" ,
130
+ target_os = "espidf" ,
131
+ target_os = "horizon" ,
132
+ target_os = "linux" ,
133
+ target_os = "freebsd" ,
134
+ target_os = "openbsd" ,
135
+ target_vendor = "apple" ,
136
+ ) ) ) ]
137
+ pub ( crate ) const LISTEN_BACKLOG_SIZE : i32 = libc:: SOMAXCONN ;
0 commit comments