Tokio TcpListener - detecting network issues

⚓ Rust    📅 2026-03-19    👤 surdeus    👁️ 6      

surdeus

Hi folks,

With tokio TcpListener, while awaiting a read operation, what is the proper way to detect network issues (say, cable unplugged, network card unplugged etc)?
I was surprised to find out read() doesn't return an error, but instead continues awaiting after I pull the cable.
I could only find this thread, but it deals with issues on the client side.
https://users.rust-lang.org/t/tokio-detect-connection-loss/116217/3

1 post - 1 participant

Read full topic

🏷️ Rust_feed