Skip to content

Commit

Permalink
net: fix named pipe connect
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Nov 18, 2022
1 parent d658262 commit e5c0d40
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions tokio/src/net/windows/named_pipe.rs
Expand Up @@ -192,17 +192,7 @@ impl NamedPipeServer {
/// # Ok(()) }
/// ```
pub async fn connect(&self) -> io::Result<()> {
loop {
match self.io.connect() {
Ok(()) => break,
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
self.io.registration().readiness(Interest::WRITABLE).await?;
}
Err(e) => return Err(e),
}
}

Ok(())
self.io.registration().async_io(Interest::WRITABLE, || self.io.connect()).await
}

/// Disconnects the server end of a named pipe instance from a client
Expand Down

0 comments on commit e5c0d40

Please sign in to comment.