Skip to content

Commit

Permalink
fix named pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
satakuma committed Nov 18, 2022
1 parent 4fe51c9 commit dbdad85
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions tokio/src/net/windows/named_pipe.rs
Expand Up @@ -192,10 +192,21 @@ impl NamedPipeServer {
/// # Ok(()) }
/// ```
pub async fn connect(&self) -> io::Result<()> {
self.io
.registration()
.async_io(Interest::WRITABLE, || self.io.connect())
.await
loop {
match self.io.connect() {
Ok(()) => break,
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
return self
.io
.registration()
.async_io(Interest::WRITABLE, || self.io.connect())
.await
}
Err(e) => return Err(e),
}
}

Ok(())
}

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

0 comments on commit dbdad85

Please sign in to comment.