Add timeout when waiting for named pipe.
This commit is contained in:
parent
1147824a0f
commit
80d9794c09
|
@ -10,7 +10,7 @@ futures = "0.1"
|
|||
tokio = "0.1"
|
||||
rand = "0.3"
|
||||
mio-named-pipes = { git = "https://github.com/alexcrichton/mio-named-pipes" }
|
||||
miow = "0.3.2"
|
||||
miow = "~0.3.2"
|
||||
log = "*"
|
||||
bytes = "0.4"
|
||||
|
||||
|
|
|
@ -251,7 +251,8 @@ impl IpcConnection {
|
|||
use std::os::windows::io::{FromRawHandle, IntoRawHandle};
|
||||
use winapi::um::winbase::FILE_FLAG_OVERLAPPED;
|
||||
|
||||
miow::pipe::NamedPipe::wait(path, None)?;
|
||||
// Wait for the pipe to become available and fail after 3 seconds.
|
||||
miow::pipe::NamedPipe::wait(path, Some(std::time::Duration::from_millis(3000)))?;
|
||||
let mut options = OpenOptions::new();
|
||||
options.read(true)
|
||||
.write(true)
|
||||
|
|
Loading…
Reference in New Issue