Skip to content

Commit 6919d8d

Browse files
committed
await for stream to become writable
1 parent 9c0350c commit 6919d8d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

crates/nfs3_client/src/smol.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ impl Connector for SmolConnector {
7676
return Err(err);
7777
}
7878
}
79-
79+
8080
let std_stream: std::net::TcpStream = socket.into();
81-
let tcp_stream = TcpStream::try_from(std_stream)?;
82-
Ok(SmolIo::new(tcp_stream))
81+
let async_socket = smol::Async::new_nonblocking(std_stream)?;
82+
// The stream becomes writable when connected.
83+
async_socket.writable().await?;
84+
85+
Ok(SmolIo::new(async_socket.into()))
8386
}
8487
}

0 commit comments

Comments
 (0)