@@ -923,35 +923,35 @@ impl<H> Easy2<H> {
923
923
self . setopt_long ( curl_sys:: CURLOPT_TCP_NODELAY , enable as c_long )
924
924
}
925
925
926
- // // / Configures whether TCP keepalive probes will be sent.
927
- // // /
928
- // // / The delay and frequency of these probes is controlled by `tcp_keepidle`
929
- // // / and `tcp_keepintvl`.
930
- // // /
931
- // // / By default this option is `false` and corresponds to
932
- // // / `CURLOPT_TCP_KEEPALIVE`.
933
- // pub fn tcp_keepalive(&mut self, enable: bool) -> Result<(), Error> {
934
- // self.setopt_long(curl_sys::CURLOPT_TCP_KEEPALIVE, enable as c_long)
935
- // }
926
+ /// Configures whether TCP keepalive probes will be sent.
927
+ ///
928
+ /// The delay and frequency of these probes is controlled by `tcp_keepidle`
929
+ /// and `tcp_keepintvl`.
930
+ ///
931
+ /// By default this option is `false` and corresponds to
932
+ /// `CURLOPT_TCP_KEEPALIVE`.
933
+ pub fn tcp_keepalive ( & mut self , enable : bool ) -> Result < ( ) , Error > {
934
+ self . setopt_long ( curl_sys:: CURLOPT_TCP_KEEPALIVE , enable as c_long )
935
+ }
936
936
937
- // // / Configures the TCP keepalive idle time wait.
938
- // // /
939
- // // / This is the delay, after which the connection is idle, keepalive probes
940
- // // / will be sent. Not all operating systems support this.
941
- // // /
942
- // // / By default this corresponds to `CURLOPT_TCP_KEEPIDLE`.
943
- // pub fn tcp_keepidle(&mut self, amt: Duration) -> Result<(), Error> {
944
- // self.setopt_long(curl_sys::CURLOPT_TCP_KEEPIDLE,
945
- // amt.as_secs() as c_long)
946
- // }
947
- //
948
- // // / Configures the delay between keepalive probes.
949
- // // /
950
- // // / By default this corresponds to `CURLOPT_TCP_KEEPINTVL`.
951
- // pub fn tcp_keepintvl(&mut self, amt: Duration) -> Result<(), Error> {
952
- // self.setopt_long(curl_sys::CURLOPT_TCP_KEEPINTVL,
953
- // amt.as_secs() as c_long)
954
- // }
937
+ /// Configures the TCP keepalive idle time wait.
938
+ ///
939
+ /// This is the delay, after which the connection is idle, keepalive probes
940
+ /// will be sent. Not all operating systems support this.
941
+ ///
942
+ /// By default this corresponds to `CURLOPT_TCP_KEEPIDLE`.
943
+ pub fn tcp_keepidle ( & mut self , amt : Duration ) -> Result < ( ) , Error > {
944
+ self . setopt_long ( curl_sys:: CURLOPT_TCP_KEEPIDLE ,
945
+ amt. as_secs ( ) as c_long )
946
+ }
947
+
948
+ /// Configures the delay between keepalive probes.
949
+ ///
950
+ /// By default this corresponds to `CURLOPT_TCP_KEEPINTVL`.
951
+ pub fn tcp_keepintvl ( & mut self , amt : Duration ) -> Result < ( ) , Error > {
952
+ self . setopt_long ( curl_sys:: CURLOPT_TCP_KEEPINTVL ,
953
+ amt. as_secs ( ) as c_long )
954
+ }
955
955
956
956
/// Configures the scope for local IPv6 addresses.
957
957
///
0 commit comments