rust-utp
rust-utp copied to clipboard
CloneableSocket recv() not understanding closed connections
I am calling close() on a CloneableSocket but it does not appear to cause reads in the other side CloneableSocket to exit with an Err. This is because CloneableSocket's recv() is missing the same closed connection detection logic as UtpSocket's recv_form().
The other thing we need is to detect ungraceful connection close. Either a heartbeat, or a timeout since last packet received would work.
It should be fixed on e7d6cdb.
The other thing we need is to detect ungraceful connection close. Either a heartbeat, or a timeout since last packet received would work.
I'm aware of that. I used to have timeout detection working before the Rust reforms that removed the set_read_timeout
method on UdpSocket
. :disappointed:
[...] before the Rust reforms that removed the
set_read_timeout
method onUdpSocket
. :disappointed:
It has been available as an unstable feature for a while. Unfortunately we can't depend on it because the library must be compatible with stable rust.
The ability to set timeouts has been reimplemented in the with_read_timeout
subcrate, and the latest master is using it to detect timeouts. When a new version is published, I'll close this issue.
The ability to set timeouts has been reimplemented in the with_read_timeout subcrate, and the latest master is using it to detect timeouts. When a new version is published, I'll close this issue.
I see there is no way for myself to use timeouts at every request. I'll write some code and send a PR.
I see there is no way for myself to use timeouts at every request. I'll write some code and send a PR.
Just dropping a link to the PR: https://github.com/meqif/rust-utp/pull/10