Add read timeout to Baichuan socket

This might help with #13, although I remain unable to reproduce it
exactly as described.
This commit is contained in:
George Hilliard committed 2020-06-13 18:17:34 -05:00
1 parent 283f70cac4
commit bfa1fdf3b3
1 file changed
+2
+2
View File
@@ -160,6 +160,8 @@ fn connect_to(addr: SocketAddr, timeout: Duration) -> Result<TcpStream> {
};
socket.set_keepalive(Some(timeout))?;
socket.set_read_timeout(Some(timeout))?;
socket.set_write_timeout(Some(timeout))?;
socket.connect_timeout(&addr.into(), timeout)?;
Ok(socket.into_tcp_stream())