Archived
add timeout setter for tcp
This commit is contained in:
1 parent
a1a64aadab
commit
1441bf9a1b
1 file changed
+5
@@ -35,6 +35,11 @@ impl PacketTransportTcpWithCobs {
|
||||
})
|
||||
}
|
||||
|
||||
/// Calls [std::net::TcpStream::set_read_timeout].
|
||||
pub fn set_read_timeout(&mut self, duration: Option<Duration>) -> std::io::Result<()> {
|
||||
self.tcp_stream.set_read_timeout(duration)
|
||||
}
|
||||
|
||||
/// Send a packet.
|
||||
///
|
||||
/// It encodes the packet using COBS encoding before sending it over the TCP stream.
|
||||
|
||||
Reference in new issue
Block a user