portable service

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-11-10 10:27:13 +08:00
parent eb60ab0b79
commit 8e1545b432
46 changed files with 1217 additions and 72 deletions

View File

@@ -49,6 +49,8 @@ pub const NAME_POS: &'static str = "";
}
mod connection;
#[cfg(windows)]
pub mod portable_service;
mod service;
mod video_qos;
pub mod video_service;
@@ -60,6 +62,7 @@ type ConnMap = HashMap<i32, ConnInner>;
lazy_static::lazy_static! {
pub static ref CHILD_PROCESS: Childs = Default::default();
pub static ref CONN_COUNT: Arc<Mutex<usize>> = Default::default();
}
pub struct Server {
@@ -259,6 +262,7 @@ impl Server {
}
}
self.connections.insert(conn.id(), conn);
*CONN_COUNT.lock().unwrap() = self.connections.len();
}
pub fn remove_connection(&mut self, conn: &ConnInner) {
@@ -266,6 +270,7 @@ impl Server {
s.on_unsubscribe(conn.id());
}
self.connections.remove(&conn.id());
*CONN_COUNT.lock().unwrap() = self.connections.len();
}
pub fn close_connections(&mut self) {