Skip to content

Commit

Permalink
🐛 Fix compilation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mokeyish authored Apr 1, 2023
1 parent 9234d0d commit 272041c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ futures-util = { version = "0.3", default-features = false, features = ["std"]}
async-trait = "0.1.43"
tokio = { version = "1.21", features = ["time", "rt", "signal", "macros", "parking_lot"] }
tokio-rustls = "0.23.4"
socket2 = { version = "0.5", features = ["all"]}
socket2 = { version = "0.5" }

# log
tracing = "0.1"
Expand Down
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,10 @@ fn tcp(
{
let sock_ref = socket2::SockRef::from(&tcp_listener);
sock_ref.set_nonblocking(true)?;
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
if let Some(device) = bind_device {
sock_ref.bind_device(Some(device.as_bytes()))?;
}
// #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
// if let Some(device) = bind_device {
// sock_ref.bind_device(Some(device.as_bytes()))?;
// }
}

let tcp_listener = TcpListener::from_std(tcp_listener)?;
Expand Down Expand Up @@ -548,10 +548,10 @@ fn udp(sock_addr: SocketAddr, bind_device: Option<&str>, bind_type: &str) -> io:
let sock_ref = socket2::SockRef::from(&udp_socket);
sock_ref.set_nonblocking(true)?;

#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
if let Some(device) = bind_device {
sock_ref.bind_device(Some(device.as_bytes()))?;
}
// #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
// if let Some(device) = bind_device {
// sock_ref.bind_device(Some(device.as_bytes()))?;
// }
}

let udp_socket = UdpSocket::from_std(udp_socket)?;
Expand Down

0 comments on commit 272041c

Please sign in to comment.