fix connect failed after setup one of sockets fails

This commit is contained in:
sijie.sun
2024-09-18 22:12:21 +08:00
committed by Sijie.Sun
parent 9f273dc887
commit 6d7edcd486
4 changed files with 25 additions and 5 deletions
+4 -1
View File
@@ -673,7 +673,10 @@ impl UdpTunnelConnector {
socket2::Type::DGRAM,
Some(socket2::Protocol::UDP),
)?;
setup_sokcet2(&socket2_socket, &bind_addr)?;
if let Err(e) = setup_sokcet2(&socket2_socket, bind_addr) {
tracing::error!(bind_addr = ?bind_addr, ?addr, "bind addr fail: {:?}", e);
continue;
}
let socket = UdpSocket::from_std(socket2_socket.into())?;
futures.push(self.try_connect_with_socket(Arc::new(socket), addr));
}