Auto merge of #24594 - doomsplayer:patch-2, r=alexcrichton
why use dummy implementation on linux?
This commit is contained in:
commit
2214860d4a
@ -202,15 +202,19 @@ impl TcpStream {
|
|||||||
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE,
|
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE,
|
||||||
seconds as c_int)
|
seconds as c_int)
|
||||||
}
|
}
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
|
#[cfg(any(target_os = "freebsd",
|
||||||
|
target_os = "dragonfly",
|
||||||
|
target_os = "linux"))]
|
||||||
fn set_tcp_keepalive(&self, seconds: u32) -> io::Result<()> {
|
fn set_tcp_keepalive(&self, seconds: u32) -> io::Result<()> {
|
||||||
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE,
|
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE,
|
||||||
seconds as c_int)
|
seconds as c_int)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(target_os = "macos",
|
#[cfg(not(any(target_os = "macos",
|
||||||
target_os = "ios",
|
target_os = "ios",
|
||||||
target_os = "freebsd",
|
target_os = "freebsd",
|
||||||
target_os = "dragonfly")))]
|
target_os = "dragonfly",
|
||||||
|
target_os = "linux")))]
|
||||||
fn set_tcp_keepalive(&self, _seconds: u32) -> io::Result<()> {
|
fn set_tcp_keepalive(&self, _seconds: u32) -> io::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user