blocking: add tcp_keepalive option (#1100)

This commit is contained in:
Martin André
2020-12-07 16:56:56 +01:00
committed by GitHub
parent 3cd9c29b30
commit a2133aec3b

View File

@@ -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<D>(self, val: D) -> ClientBuilder
where
D: Into<Option<Duration>>,
{
self.with_inner(move |inner| inner.tcp_keepalive(val))
}
// TLS options
/// Add a custom root certificate.