Skip to content

Commit

Permalink
Fix compilation on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
  • Loading branch information
wiktor-k committed Mar 24, 2024
1 parent e494afa commit b86b1fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use bytes::{Buf, BufMut, BytesMut};
use futures::{SinkExt, TryStreamExt};
use log::{error, info};
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::net::{TcpListener, TcpStream, UnixListener, UnixStream};
use tokio::net::{TcpListener, TcpStream};
#[cfg(unix)]
use tokio::net::{UnixListener, UnixStream};
use tokio_util::codec::{Decoder, Encoder, Framed};

use std::fmt;
Expand Down Expand Up @@ -59,6 +61,7 @@ pub trait ListeningSocket {
async fn accept(&self) -> io::Result<Self::Stream>;
}

#[cfg(unix)]
#[async_trait]
impl ListeningSocket for UnixListener {
type Stream = UnixStream;
Expand Down Expand Up @@ -134,6 +137,7 @@ pub trait Agent: 'static + Sync + Send + Sized {
}
async fn bind(mut self, listener: service_binding::Listener) -> Result<(), AgentError> {
match listener {
#[cfg(unix)]
service_binding::Listener::Unix(listener) => {
self.listen(UnixListener::from_std(listener)?).await
}
Expand Down

0 comments on commit b86b1fd

Please sign in to comment.