From 5078a1f7971f4b5a507bd7164f1eb960e5195369 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 24 May 2024 18:37:11 +0800 Subject: reuse port, and revert hbbr `-k` --- src/rendezvous_server.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rendezvous_server.rs') diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs index 0c0d107..bb99ee0 100644 --- a/src/rendezvous_server.rs +++ b/src/rendezvous_server.rs @@ -1294,19 +1294,19 @@ async fn send_rk_res( async fn create_udp_listener(port: i32, rmem: usize) -> ResultType { let addr = SocketAddr::new(IpAddr::V6(Ipv6Addr::UNSPECIFIED), port as _); - if let Ok(s) = FramedSocket::new_reuse(&addr, false, rmem).await { + if let Ok(s) = FramedSocket::new_reuse(&addr, true, rmem).await { log::debug!("listen on udp {:?}", s.local_addr()); return Ok(s); } let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), port as _); - let s = FramedSocket::new_reuse(&addr, false, rmem).await?; + let s = FramedSocket::new_reuse(&addr, true, rmem).await?; log::debug!("listen on udp {:?}", s.local_addr()); Ok(s) } #[inline] async fn create_tcp_listener(port: i32) -> ResultType { - let s = listen_any(port as _).await?; + let s = listen_any(port as _, true).await?; log::debug!("listen on tcp {:?}", s.local_addr()); Ok(s) } -- cgit v1.2.3