mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2024-11-27 23:29:00 +08: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));
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user