diff --git a/src/v038/server.rs b/src/v038/server.rs index 881fdb1..8cd1eb9 100644 --- a/src/v038/server.rs +++ b/src/v038/server.rs @@ -1,12 +1,11 @@ use std::convert::{TryFrom, TryInto}; -use std::path::Path; use futures::future::{FutureExt, TryFutureExt}; use futures::sink::SinkExt; use futures::stream::{FuturesOrdered, StreamExt}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::{ - net::{TcpListener, ToSocketAddrs, UnixListener}, + net::{TcpListener, ToSocketAddrs}, select, }; use tokio_util::codec::{FramedRead, FramedWrite}; @@ -126,8 +125,9 @@ where ServerBuilder::default() } - pub async fn listen_unix(self, path: impl AsRef) -> Result<(), BoxError> { - let listener = UnixListener::bind(path)?; + #[cfg(target_family = "unix")] + pub async fn listen_unix(self, path: impl AsRef) -> Result<(), BoxError> { + let listener = tokio::net::UnixListener::bind(path)?; let addr = listener.local_addr()?; tracing::info!(?addr, "ABCI server starting on uds");