mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2026-02-16 02:20:41 +00:00
refactor
This commit is contained in:
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));
|
||||
}
|
||||
|
||||
fn is_running() -> bool {
|
||||
!*STOP.lock().unwrap()
|
||||
}
|
||||
|
||||
pub fn start(license: &str, host: &str) {
|
||||
if is_running() {
|
||||
return;
|
||||
}
|
||||
*STOP.lock().unwrap() = false;
|
||||
pub fn bootstrap(license: &str, host: &str) {
|
||||
let port = rendezvous_server::DEFAULT_PORT;
|
||||
let addr = format!("0.0.0.0:{}", port);
|
||||
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() {
|
||||
*STOP.lock().unwrap() = true;
|
||||
}
|
||||
|
||||
pub fn start() {
|
||||
*STOP.lock().unwrap() = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user