How do I know when the client ends the TcpStream
? I don't get an error when trying to read from a TcpStream
which I've closed on the client side.
s is a TcpStream
let mut recv = [0; 1024];
match recv_s.read(&mut recv) {
Ok(b) => { println!("read") },
Err(e) => {
println!("error");
},
}