We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39d4110 commit 9c0350cCopy full SHA for 9c0350c
1 file changed
crates/nfs3_client/src/smol.rs
@@ -66,7 +66,16 @@ impl Connector for SmolConnector {
66
let socket = socket2::Socket::new(domain, ty, Some(socket2::Protocol::TCP))?;
67
socket.set_nonblocking(true)?;
68
socket.bind(&local_addr.into())?;
69
- socket.connect(&remote_addr.into())?;
+ if let Err(err) = socket.connect(&remote_addr.into()) {
70
+ #[cfg(unix)]
71
+ if err.raw_os_error() != Some(libc::EINPROGRESS) {
72
+ return Err(err);
73
+ }
74
+ #[cfg(windows)]
75
+ if err.kind() != std::io::ErrorKind::WouldBlock {
76
77
78
79
80
let std_stream: std::net::TcpStream = socket.into();
81
let tcp_stream = TcpStream::try_from(std_stream)?;
0 commit comments