We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 714bd49 + 4d6e2f5 commit 2214860Copy full SHA for 2214860
src/libstd/sys/common/net2.rs
@@ -202,15 +202,19 @@ impl TcpStream {
202
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE,
203
seconds as c_int)
204
}
205
- #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
+ #[cfg(any(target_os = "freebsd",
206
+ target_os = "dragonfly",
207
+ target_os = "linux"))]
208
fn set_tcp_keepalive(&self, seconds: u32) -> io::Result<()> {
209
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE,
210
211
212
+
213
#[cfg(not(any(target_os = "macos",
214
target_os = "ios",
215
target_os = "freebsd",
- target_os = "dragonfly")))]
216
217
+ target_os = "linux")))]
218
fn set_tcp_keepalive(&self, _seconds: u32) -> io::Result<()> {
219
Ok(())
220
0 commit comments