async-std
async-std copied to clipboard
Force timeout on potentially blocking IO calls
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 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.
Any updates on this?