mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix: ios build
This commit is contained in:
@@ -6,12 +6,13 @@ use hbb_common::{
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
use crate::Connection;
|
||||
|
||||
const TIME_HEARTBEAT: Duration = Duration::from_secs(30);
|
||||
const TIME_CONN: Duration = Duration::from_secs(3);
|
||||
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
lazy_static::lazy_static! {
|
||||
static ref SENDER : Mutex<broadcast::Sender<Vec<i32>>> = Mutex::new(start_hbbs_sync());
|
||||
}
|
||||
@@ -21,10 +22,12 @@ pub fn start() {
|
||||
let _sender = SENDER.lock().unwrap();
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
pub fn signal_receiver() -> broadcast::Receiver<Vec<i32>> {
|
||||
SENDER.lock().unwrap().subscribe()
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
fn start_hbbs_sync() -> broadcast::Sender<Vec<i32>> {
|
||||
let (tx, _rx) = broadcast::channel::<Vec<i32>>(16);
|
||||
std::thread::spawn(move || start_hbbs_sync_async());
|
||||
@@ -37,6 +40,7 @@ pub struct StrategyOptions {
|
||||
pub extra: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn start_hbbs_sync_async() {
|
||||
tokio::spawn(async move {
|
||||
|
||||
Reference in New Issue
Block a user