Skip to content

Commit

Permalink
blocking: add tcp_keepalive option (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Martichou committed Dec 7, 2020
1 parent 3cd9c29 commit a2133ae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/blocking/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a2133ae

Please sign in to comment.