about summary refs log tree commit diff
path: root/src/libstd/net
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2016-02-27 21:05:32 -0800
committerSteven Fackler <sfackler@gmail.com>2016-02-28 09:41:33 -0800
commit728d9115e894bd3c8fc3ae03230ea46f85467c04 (patch)
tree3e5867efbe40eb47af9655ba457137cb1d1f82a1 /src/libstd/net
parent5d6ba17f0308d3b8c96cd89f4c0663bae0f2b9f7 (diff)
downloadrust-728d9115e894bd3c8fc3ae03230ea46f85467c04.tar.gz
rust-728d9115e894bd3c8fc3ae03230ea46f85467c04.zip
Fix windows
Also back out keepalive support for TCP since the API is perhaps not
actually what we want. You can't read the interval on Windows, and
we should probably separate the functionality of turning keepalive on
and overriding the interval.
Diffstat (limited to 'src/libstd/net')
-rw-r--r--src/libstd/net/tcp.rs43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index b8530c98398..0073b8f119a 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -203,34 +203,6 @@ impl TcpStream {
         self.0.nodelay()
     }
 
-    /// Sets whether keepalive messages are enabled to be sent on this socket.
-    ///
-    /// On Unix, this option will set the `SO_KEEPALIVE` as well as the
-    /// `TCP_KEEPALIVE` or `TCP_KEEPIDLE` option (depending on your platform).
-    /// On Windows, this will set the `SIO_KEEPALIVE_VALS` option.
-    ///
-    /// If `None` is specified then keepalive messages are disabled, otherwise
-    /// the duration specified will be the time to remain idle before sending a
-    /// TCP keepalive probe.
-    ///
-    /// Some platforms specify this value in seconds, so sub-second
-    /// specifications may be omitted.
-    #[stable(feature = "net2_mutators", since = "1.9.0")]
-    pub fn set_keepalive(&self, keepalive: Option<Duration>) -> io::Result<()> {
-        self.0.set_keepalive(keepalive)
-    }
-
-    /// Returns whether keepalive messages are enabled on this socket, and if so
-    /// the duration of time between them.
-    ///
-    /// For more information about this option, see [`set_keepalive`][link].
-    ///
-    /// [link]: #tymethod.set_keepalive
-    #[stable(feature = "net2_mutators", since = "1.9.0")]
-    pub fn keepalive(&self) -> io::Result<Option<Duration>> {
-        self.0.keepalive()
-    }
-
     /// Sets the value for the `IP_TTL` option on this socket.
     ///
     /// This value sets the time-to-live field that is used in every packet sent
@@ -1157,21 +1129,6 @@ mod tests {
     }
 
     #[test]
-    fn keepalive() {
-        let addr = next_test_ip4();
-        let _listener = t!(TcpListener::bind(&addr));
-
-        let stream = t!(TcpStream::connect(&("localhost", addr.port())));
-        let dur = Duration::new(15410, 0);
-
-        assert_eq!(None, t!(stream.keepalive()));
-        t!(stream.set_keepalive(Some(dur)));
-        assert_eq!(Some(dur), t!(stream.keepalive()));
-        t!(stream.set_keepalive(None));
-        assert_eq!(None, t!(stream.keepalive()));
-    }
-
-    #[test]
     fn ttl() {
         let ttl = 100;