We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00978a9 commit ea58799Copy full SHA for ea58799
src/libstd/sys/common/net2.rs
@@ -207,10 +207,16 @@ impl TcpStream {
207
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE,
208
seconds as c_int)
209
}
210
+ #[cfg(target_os = "linux")]
211
+ fn set_tcp_keepalive(&self, seconds: u32) -> io::Result<()> {
212
+ setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE,
213
+ seconds as c_int)
214
+ }
215
#[cfg(not(any(target_os = "macos",
216
target_os = "ios",
217
target_os = "freebsd",
- target_os = "dragonfly")))]
218
+ target_os = "dragonfly",
219
+ target_os = "linux")))]
220
fn set_tcp_keepalive(&self, _seconds: u32) -> io::Result<()> {
221
Ok(())
222
0 commit comments