Skip to content

Commit

Permalink
remove windows-sys
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Nov 20, 2023
1 parent 83c3d40 commit c0f0ace
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
3 changes: 0 additions & 3 deletions pallas-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ thiserror = "1.0.31"
tokio = { version = "1", features = ["net", "io-util", "time", "sync", "macros"] }
tracing = "0.1.37"

[target.'cfg(windows)'.dependencies]
windows-sys = "0.48.0"

[dev-dependencies]
tracing-subscriber = "0.3.16"
tokio = { version = "1", features = ["full"] }
Expand Down
17 changes: 1 addition & 16 deletions pallas-network/src/multiplexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,7 @@ impl Bearer {
pub async fn connect_named_pipe(
pipe_name: impl AsRef<std::ffi::OsStr>,
) -> Result<Self, tokio::io::Error> {
// TODO: revisit if busy wait logic is required
let client = loop {
match tokio::net::windows::named_pipe::ClientOptions::new().open(&pipe_name) {
Ok(client) => break client,
Err(e)
if e.raw_os_error()
== Some(windows_sys::Win32::Foundation::ERROR_PIPE_BUSY as i32) =>
{
()
}
Err(e) => return Err(e),
}

tokio::time::sleep(std::time::Duration::from_millis(50)).await;
};

let client = tokio::net::windows::named_pipe::ClientOptions::new().open(&pipe_name)?;
Ok(Self::NamedPipe(client))
}

Expand Down

0 comments on commit c0f0ace

Please sign in to comment.