rust-utp
rust-utp copied to clipboard
add read timeout
This commit adds a set_read_timeout
function similar to Rust's
set_read_timeout
[1]. The differences compared to upstream are:
- Operation always succeed.
- It takes an i64 instead Duration.
[1] https://doc.rust-lang.org/nightly/std/net/struct.UdpSocket.html#method.set_read_timeout
PR updated/rebased
PR updated.
It's a lot more stable now.
On our usage of rust-utp, a stress test to study rust-utp was used and the failure rate was around 50%. With the new set-read-timeout
, failure rate went to 0% (we already executed the test plenty of time and still no sign of failure). It's definitively more stable now.
We're still executing tests to find more problems within rust-utp and we found a few:
- https://github.com/inetic/rust-utp/commit/1a578c6f70afc286faa1fe507a0cbdb08db2c76e
- https://github.com/inetic/rust-utp/commit/66e5b716a8c9d19ee54c56873bc451ff78088c73
- https://github.com/inetic/rust-utp/commit/a7b30f0ef2d1cd6a82e43ad463750e86e1ddb6a6
- https://github.com/meqif/rust-utp/pull/24
All of them touches different parts of the code and show problems that are unrelated to this PR. I'd appreciate any input on this, as it's becoming a burden to maintain separate sets of patchsets. Merging just this one PR would already make things a tad easier, as it'd allow me to maintain the same set of changes to our code and to the upstream rust-utp
, as this PR introduces a fundamental change in code.