diff --git a/src/blocking/client.rs b/src/blocking/client.rs index 3684483..60f6992 100644 --- a/src/blocking/client.rs +++ b/src/blocking/client.rs @@ -409,6 +409,18 @@ impl ClientBuilder { self.with_inner(move |inner| inner.local_address(addr)) } + /// Set that all sockets have `SO_KEEPALIVE` set with the supplied duration. + /// + /// If `None`, the option will not be set. + /// + /// Default is 60 seconds. + pub fn tcp_keepalive(self, val: D) -> ClientBuilder + where + D: Into>, + { + self.with_inner(move |inner| inner.tcp_keepalive(val)) + } + // TLS options /// Add a custom root certificate.