mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 15:53:00 +08:00
refactor punch hole
This commit is contained in:
parent
e1bc6e34b3
commit
cb640e48c5
@ -379,7 +379,10 @@ impl RendezvousMediator {
|
||||
)
|
||||
.await?;
|
||||
let local_addr = socket.local_addr();
|
||||
allow_err!(socket_client::connect_tcp(peer_addr, local_addr, 300).await);
|
||||
// key important here for punch hole to tell gateway incoming peer is safe.
|
||||
// before we use 300ms, 1000ms seems more safe.
|
||||
// it can not be async here, because local_addr can not be reused, we must close the connection before use it again.
|
||||
allow_err!(socket_client::connect_tcp(peer_addr, local_addr, 1000).await);
|
||||
socket
|
||||
};
|
||||
let mut msg_out = Message::new();
|
||||
|
Loading…
Reference in New Issue
Block a user