mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2025-07-04 00:35:35 +00:00
refactor
This commit is contained in:
parent
9132d85f74
commit
457c74d203
14
mod.rs
14
mod.rs
@ -8,15 +8,7 @@ lazy_static::lazy_static! {
|
|||||||
static ref STOP: Arc<Mutex<bool>> = Arc::new(Mutex::new(true));
|
static ref STOP: Arc<Mutex<bool>> = Arc::new(Mutex::new(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_running() -> bool {
|
pub fn bootstrap(license: &str, host: &str) {
|
||||||
!*STOP.lock().unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn start(license: &str, host: &str) {
|
|
||||||
if is_running() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*STOP.lock().unwrap() = false;
|
|
||||||
let port = rendezvous_server::DEFAULT_PORT;
|
let port = rendezvous_server::DEFAULT_PORT;
|
||||||
let addr = format!("0.0.0.0:{}", port);
|
let addr = format!("0.0.0.0:{}", port);
|
||||||
let addr2 = format!("0.0.0.0:{}", port.parse::<i32>().unwrap_or(0) - 1);
|
let addr2 = format!("0.0.0.0:{}", port.parse::<i32>().unwrap_or(0) - 1);
|
||||||
@ -47,3 +39,7 @@ pub fn start(license: &str, host: &str) {
|
|||||||
pub fn stop() {
|
pub fn stop() {
|
||||||
*STOP.lock().unwrap() = true;
|
*STOP.lock().unwrap() = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn start() {
|
||||||
|
*STOP.lock().unwrap() = false;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user