Closed
Description
Location
This is a continuation of #115451
Summary
The following block of code has unexpected behavior as it will likely not write_all bytes to the stream but there is no way for user to know who many if any where written.
Perhaps the trait should take a mut buf: &[u8] so that the user can check? In either case it is a very hard issue to troubleshot as it fails only on some platforms and under certain conditions yet there is no mention anywhere that nonblocking sockets and io::Write ::write_all method are not compatible.
let mut stream = TcpStream::connect(add).unwrap();
stream.nonblocking(true).unwrap()
let buf = [1,2,3,4,5];
// THIS LINE WILL sometime propagate a WouldBlock error kind however it would have written X number of bytes to the steam with out a way too tell if X is =0 or X<buf.len()
stream.write_all(&buf[..]);