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
+5 -1
View File
@@ -241,7 +241,11 @@ impl WSTunnelConnector {
socket2::Type::STREAM,
Some(socket2::Protocol::TCP),
)?;
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 = TcpSocket::from_std_stream(socket2_socket.into());
futures.push(Self::connect_with(