Skip to content

Commit

Permalink
recreate udp socket
Browse files Browse the repository at this point in the history
  • Loading branch information
rustdesk authored Apr 26, 2021
1 parent 9103fd3 commit 619fba5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rendezvous_mediator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ impl RendezvousMediator {
Config::update_latency(&host, -1);
old_latency = 0;
if now.duration_since(last_dns_check).map(|d| d.as_millis() as i64).unwrap_or(0) > DNS_INTERVAL {
allow_err!(rz.dns_check());
if let Ok(_) = rz.dns_check() {
// in some case of network reconnect (dial IP network),
// old UDP socket not work any more after network recover
socket = FramedSocket::new(Config::get_any_listen_addr()).await?;
}
last_dns_check = now;
}
} else if fails > MAX_FAILS1 {
Expand Down

0 comments on commit 619fba5

Please sign in to comment.