This commit is contained in:
rustdesk 2023-06-30 13:37:51 +08:00
parent 15a8b66140
commit 907a62a586

View File

@ -593,12 +593,18 @@ impl Client {
let mut succeed = false;
let mut uuid = "".to_owned();
let mut ipv4 = true;
for i in 1..=3 {
// use different socket due to current hbbs implement requiring different nat address for each attempt
// use different socket due to current hbbs implementation requiring different nat address for each attempt
let mut socket = socket_client::connect_tcp(rendezvous_server, CONNECT_TIMEOUT)
.await
.with_context(|| "Failed to connect to rendezvous server")?;
if !key.is_empty() && !token.is_empty() {
// mainly for the security of token
allow_err!(secure_punch_connection(&mut socket, key).await);
}
ipv4 = socket.local_addr().is_ipv4();
let mut msg_out = RendezvousMessage::new();
uuid = Uuid::new_v4().to_string();