shorter punch
This commit is contained in:
parent
cb640e48c5
commit
12390a66e8
@ -379,10 +379,9 @@ impl RendezvousMediator {
|
||||
)
|
||||
.await?;
|
||||
let local_addr = socket.local_addr();
|
||||
// key important here for punch hole to tell gateway incoming peer is safe.
|
||||
// before we use 300ms, 1000ms seems more safe.
|
||||
// key important here for punch hole to tell my gateway incoming peer is 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);
|
||||
allow_err!(socket_client::connect_tcp(peer_addr, local_addr, 30).await);
|
||||
socket
|
||||
};
|
||||
let mut msg_out = Message::new();
|
||||
|
Loading…
x
Reference in New Issue
Block a user