Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d8f59bd

Browse files
fail fast on io::ErrorKind::NotConnected (async-rs#21)
1 parent 60d8a37 commit d8f59bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/lib.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,9 @@ impl Async<UnixStream> {
12221222
// The stream becomes writable when connected.
12231223
stream.writable().await?;
12241224

1225+
// On Linux, it appears the socket may become writable even when connecting fails, so we
1226+
// must do an extra check here and see if the peer address is retrievable.
1227+
stream.get_ref().peer_addr()?;
12251228
Ok(stream)
12261229
}
12271230

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /