Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help/Bug] TcpConnection::write_all does not return an error when there are internet issues or a disconnected connection. #6678

Open
EnvOut opened this issue Jul 8, 2024 Discussed in #6676 · 1 comment
Labels
A-tokio Area: The main tokio crate M-net Module: tokio/net

Comments

@EnvOut
Copy link

EnvOut commented Jul 8, 2024

Discussed in #6676

Originally posted by EnvOut July 8, 2024
Hello everyone,

I've faced a strange problem when working with TcpConnection. Having an initialized connection using:

TcpStream::connect(pool_info.url)

even if the ethernet (Wi-Fi) is turned off, subsequent write operations do not return std::io::Error:

con.write_all(buf.as_slice()).await.unwrap();
con.flush().await.unwrap();

This seems quite strange, and I was wondering if you could suggest how to still get an io::Error if there is a problem with the connection?
Tokio version:

tokio = { version = "1.36.0", features = ["full", "tracing"] }

#help #bug

@Darksonn
Copy link
Contributor

Darksonn commented Jul 9, 2024

What happens if you keep writing? This is most likely just how the OS behaves, and I doubt there's anything we can do about it.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-net Module: tokio/net labels Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-net Module: tokio/net
Projects
None yet
Development

No branches or pull requests

2 participants