async-std icon indicating copy to clipboard operation
async-std copied to clipboard

Force timeout on potentially blocking IO calls

Open 0b01 opened this issue 6 years ago • 1 comments

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.

0b01 avatar Dec 04 '19 22:12 0b01

Any updates on this?

manikawnth avatar Sep 14 '20 23:09 manikawnth