mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-02 15:11:28 +03:00
hc
This commit is contained in:
@@ -21,11 +21,7 @@ use hbb_common::{
|
||||
sleep,
|
||||
socket_client::{self, connect_tcp, is_ipv4},
|
||||
tcp::FramedStream,
|
||||
tokio::{
|
||||
self, select,
|
||||
sync::Mutex,
|
||||
time::{interval, Duration},
|
||||
},
|
||||
tokio::{self, select, sync::Mutex, time::interval},
|
||||
udp::FramedSocket,
|
||||
AddrMangle, IntoTargetAddr, ResultType, TargetAddr,
|
||||
};
|
||||
@@ -37,9 +33,6 @@ use crate::{
|
||||
|
||||
type Message = RendezvousMessage;
|
||||
|
||||
const TIMER_OUT: Duration = Duration::from_secs(1);
|
||||
const DEFAULT_KEEP_ALIVE: i32 = 60_000;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref SOLVING_PK_MISMATCH: Arc<Mutex<String>> = Default::default();
|
||||
}
|
||||
@@ -151,10 +144,10 @@ impl RendezvousMediator {
|
||||
addr: addr.clone(),
|
||||
host: host.clone(),
|
||||
host_prefix: Self::get_host_prefix(&host),
|
||||
keep_alive: DEFAULT_KEEP_ALIVE,
|
||||
keep_alive: crate::DEFAULT_KEEP_ALIVE,
|
||||
};
|
||||
|
||||
let mut timer = crate::rustdesk_interval(interval(TIMER_OUT));
|
||||
let mut timer = crate::rustdesk_interval(interval(crate::TIMER_OUT));
|
||||
const MIN_REG_TIMEOUT: i64 = 3_000;
|
||||
const MAX_REG_TIMEOUT: i64 = 30_000;
|
||||
let mut reg_timeout = MIN_REG_TIMEOUT;
|
||||
@@ -337,9 +330,9 @@ impl RendezvousMediator {
|
||||
addr: conn.local_addr().into_target_addr()?,
|
||||
host: host.clone(),
|
||||
host_prefix: Self::get_host_prefix(&host),
|
||||
keep_alive: DEFAULT_KEEP_ALIVE,
|
||||
keep_alive: crate::DEFAULT_KEEP_ALIVE,
|
||||
};
|
||||
let mut timer = crate::rustdesk_interval(interval(TIMER_OUT));
|
||||
let mut timer = crate::rustdesk_interval(interval(crate::TIMER_OUT));
|
||||
let mut last_register_sent: Option<Instant> = None;
|
||||
let mut last_recv_msg = Instant::now();
|
||||
// we won't support connecting to multiple rendzvous servers any more, so we can use a global variable here.
|
||||
|
||||
Reference in New Issue
Block a user