mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
wip: dual audio transmission server
This commit is contained in:
@@ -29,6 +29,13 @@ use service::{GenericService, Service, Subscriber};
|
||||
use service::ServiceTmpl;
|
||||
|
||||
use crate::ipc::{connect, Data};
|
||||
pub use service::{GenericService, Service, ServiceTmpl, Subscriber};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
net::SocketAddr,
|
||||
sync::{Arc, Mutex, RwLock, Weak},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
pub mod audio_service;
|
||||
cfg_if::cfg_if! {
|
||||
@@ -65,6 +72,13 @@ 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();
|
||||
// A client server used to provide local services(audio, video, clipboard, etc.)
|
||||
// for all initiative connections.
|
||||
//
|
||||
// [Note]
|
||||
// Now we use this [`CLIENT_SERVER`] to do following operations:
|
||||
// - record local audio, and send to remote
|
||||
pub static ref CLIENT_SERVER: ServerPtr = new();
|
||||
}
|
||||
|
||||
pub struct Server {
|
||||
@@ -316,6 +330,13 @@ impl Server {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get a new unique id
|
||||
pub fn get_new_id(&mut self) -> i32 {
|
||||
let new_id = self.id_count;
|
||||
self.id_count += 1;
|
||||
new_id
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Server {
|
||||
|
||||
Reference in New Issue
Block a user