Skip to content

Commit

Permalink
add a hack to make the buffer size 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Geordon Worley committed Sep 10, 2022
1 parent 0b1f640 commit 798a71f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,6 @@ rustc-args = ["--cfg", "tokio_unstable"]

[package.metadata.playground]
features = ["full", "test-util"]

[patch.crates-io]
mio = { git = 'https://github.com/Thomasdezeeuw/mio.git', branch = 'issue#1582_named_pipe_set_buffer_size' }
4 changes: 3 additions & 1 deletion tokio/src/net/windows/named_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,9 @@ impl NamedPipeClient {
/// [Tokio Runtime]: crate::runtime::Runtime
/// [enabled I/O]: crate::runtime::Builder::enable_io
pub unsafe fn from_raw_handle(handle: RawHandle) -> io::Result<Self> {
let named_pipe = mio_windows::NamedPipe::from_raw_handle(handle);
let mut named_pipe = mio_windows::NamedPipe::from_raw_handle(handle);

named_pipe.set_buffer_size(1);

Ok(Self {
io: PollEvented::new(named_pipe)?,
Expand Down

0 comments on commit 798a71f

Please sign in to comment.