Force timeout on potentially blocking IO calls
Open
- Dominant language
- Rust
- Stars
- 4.1k
- Forks
- 339
- PR merge metrics
- No merged PRs in 30d
Description
Recently I encountered a bug where when a buffer associated with a file descriptor(`TcpStream`) is filled, `stream.write` will block forever. Bugs of this nature are very hard to find.
[`std::net::TcpStream`](https://doc.rust-lang.org/std/net/struct.TcpStream.html#method.set_write_timeout) have functions such as `set_write_timeout`, `set_read_timeout` in addition to `set_nonblocking`. I believe async-std would benefit by including a similar `set_write_timeout` function on potentially blocking IO functions so write would return a TimeoutFuture.
Contributor guide
Assessment
This issue has not been assessed yet.