Fix read timeout handling
This commit is contained in:
parent
eaab86f344
commit
acb424afa4
@ -118,13 +118,7 @@ impl MessageStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_read_timeout(&self, timeout: Option<Duration>) -> io::Result<()> {
|
fn set_read_timeout(&self, timeout: Option<Duration>) -> io::Result<()> {
|
||||||
// self.stream.get_ref().get_ref().0.set_read_timeout(timeout)
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_nonblocking(&self, nonblock: bool) -> io::Result<()> {
|
fn set_nonblocking(&self, nonblock: bool) -> io::Result<()> {
|
||||||
|
Loading…
Reference in New Issue
Block a user