···373 if let Err(e) = sock_ref.set_tcp_nodelay(true) {
374 tracing::warn!(error = %e, "failed to set TCP_NODELAY");
375 }
376- let params = socket2::TcpKeepalive::new()
377- .with_time(Duration::from_secs(30))
378- .with_interval(Duration::from_secs(10));
00379 if let Err(e) = sock_ref.set_tcp_keepalive(¶ms) {
380 tracing::warn!(error = %e, "failed to set TCP keepalive");
381 }
···373 if let Err(e) = sock_ref.set_tcp_nodelay(true) {
374 tracing::warn!(error = %e, "failed to set TCP_NODELAY");
375 }
376+ let keepalive = socket2::TcpKeepalive::new()
377+ .with_time(Duration::from_secs(30));
378+ #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
379+ let keepalive = keepalive.with_interval(Duration::from_secs(10));
380+ let params = keepalive;
381 if let Err(e) = sock_ref.set_tcp_keepalive(¶ms) {
382 tracing::warn!(error = %e, "failed to set TCP keepalive");
383 }