Fix read timeout handling

This commit is contained in:
Steven Fackler 2017-09-20 08:32:10 -04:00
parent eaab86f344
commit acb424afa4

View File

@ -118,13 +118,7 @@ impl MessageStream {
}
fn set_read_timeout(&self, timeout: Option<Duration>) -> io::Result<()> {
// self.stream.get_ref().get_ref().0.set_read_timeout(timeout)
let s = unsafe {
::std::net::TcpStream::from_raw_fd(self.stream.get_ref().get_ref().0.as_raw_fd())
};
let r = s.set_read_timeout(timeout);
::std::mem::forget(s);
r
self.stream.get_ref().get_ref().0.set_read_timeout(timeout)
}
fn set_nonblocking(&self, nonblock: bool) -> io::Result<()> {