Skip to content

Commit

Permalink
add feature guard to unix-only listener in v038
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed May 10, 2024
1 parent 4b73065 commit 52382f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/v038/server.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -126,8 +125,9 @@ where
ServerBuilder::default()
}

pub async fn listen_unix(self, path: impl AsRef<Path>) -> Result<(), BoxError> {
let listener = UnixListener::bind(path)?;
#[cfg(target_family = "unix")]
pub async fn listen_unix(self, path: impl AsRef<std::path::Path>) -> Result<(), BoxError> {
let listener = tokio::net::UnixListener::bind(path)?;
let addr = listener.local_addr()?;
tracing::info!(?addr, "ABCI server starting on uds");

Expand Down

0 comments on commit 52382f4

Please sign in to comment.