Get nonblocking flag of TcpStream

I see we have std::net::tcp::TcpStream::set_nonblocking for setting this flag on a TcpStream instance.

If I have a TcpStream instance, and I want to read that flag (in my case, for the purpose of debugging), how would I do that?

In case this is platform specific, I'm targeting Linux.

I don't think that's exposed in the standard library but you can do it with socket2: SockRef in socket2 - Rust

1 Like

That looks fine :slight_smile: For debugging, i don't mind the extra dependency. Thank you!