From 8b8e25e3ae0204da88f5da16de8926cdda63336d Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Wed, 20 Dec 2023 09:13:39 -0300 Subject: [PATCH] hide windows for now --- pallas-network/src/facades.rs | 56 +++++++++++++++---------------- pallas-network/src/multiplexer.rs | 11 +++--- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/pallas-network/src/facades.rs b/pallas-network/src/facades.rs index 3167a269..740eba95 100644 --- a/pallas-network/src/facades.rs +++ b/pallas-network/src/facades.rs @@ -227,7 +227,7 @@ impl NodeClient { } #[cfg(unix)] - pub async fn connect2( + pub async fn connect( path: impl AsRef + Send + 'static, magic: u64, ) -> Result { @@ -254,33 +254,33 @@ impl NodeClient { Ok(client) } - #[cfg(windows)] - pub async fn connect( - pipe_name: impl AsRef, - magic: u64, - ) -> Result { - let bearer = tokio::task::spawn_blocking(move || Bearer::connect_named_pipe(pipe_name)) - .await - .expect("can't join tokio thread") - .map_err(Error::ConnectFailure)?; - - let mut client = Self::new(bearer); - - let versions = handshake::n2c::VersionTable::v10_and_above(magic); - - let handshake = client - .handshake() - .handshake(versions) - .await - .map_err(Error::HandshakeProtocol)?; - - if let handshake::Confirmation::Rejected(reason) = handshake { - error!(?reason, "handshake refused"); - return Err(Error::IncompatibleVersion); - } - - Ok(client) - } + // #[cfg(windows)] + // pub async fn connect( + // pipe_name: impl AsRef, + // magic: u64, + // ) -> Result { + // let bearer = tokio::task::spawn_blocking(move || + // Bearer::connect_named_pipe(pipe_name)) .await + // .expect("can't join tokio thread") + // .map_err(Error::ConnectFailure)?; + + // let mut client = Self::new(bearer); + + // let versions = handshake::n2c::VersionTable::v10_and_above(magic); + + // let handshake = client + // .handshake() + // .handshake(versions) + // .await + // .map_err(Error::HandshakeProtocol)?; + + // if let handshake::Confirmation::Rejected(reason) = handshake { + // error!(?reason, "handshake refused"); + // return Err(Error::IncompatibleVersion); + // } + + // Ok(client) + // } #[cfg(unix)] pub async fn handshake_query( diff --git a/pallas-network/src/multiplexer.rs b/pallas-network/src/multiplexer.rs index 704bea71..f2d17eda 100644 --- a/pallas-network/src/multiplexer.rs +++ b/pallas-network/src/multiplexer.rs @@ -115,11 +115,12 @@ impl Bearer { Ok((Self::Unix(stream), addr)) } - #[cfg(windows)] - pub fn connect_named_pipe(pipe_name: impl AsRef) -> IOResult { - let client = tokio::net::windows::named_pipe::ClientOptions::new().open(&pipe_name)?; - Ok(Self::NamedPipe(client)) - } + // #[cfg(windows)] + // pub fn connect_named_pipe(pipe_name: impl AsRef) -> + // IOResult { let client = + // tokio::net::windows::named_pipe::ClientOptions::new().open(&pipe_name)?; + // Ok(Self::NamedPipe(client)) + // } pub fn into_split(self) -> (BearerReadHalf, BearerWriteHalf) { match self {