mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-24 13:40:55 +03:00
cleanup
This commit is contained in:
@@ -48,9 +48,9 @@ pub enum CaptureEvent {
|
||||
pub fn new(
|
||||
backend: Option<CaptureBackend>,
|
||||
server: Server,
|
||||
sender_tx: Sender<(Event, SocketAddr)>,
|
||||
udp_send: Sender<(Event, SocketAddr)>,
|
||||
frontend_tx: Sender<FrontendEvent>,
|
||||
timer_notify: Arc<Notify>,
|
||||
notify_ping: Arc<Notify>,
|
||||
release_bind: Vec<scancode::Linux>,
|
||||
cancellation_token: CancellationToken,
|
||||
notify_capture: Arc<Notify>,
|
||||
@@ -60,10 +60,10 @@ pub fn new(
|
||||
let task = tokio::task::spawn_local(capture_task(
|
||||
backend,
|
||||
server,
|
||||
sender_tx,
|
||||
udp_send,
|
||||
rx,
|
||||
frontend_tx,
|
||||
timer_notify,
|
||||
notify_ping,
|
||||
release_bind,
|
||||
cancellation_token,
|
||||
notify_capture,
|
||||
|
||||
@@ -170,7 +170,7 @@ async fn do_emulation(
|
||||
}
|
||||
|
||||
// release potentially still pressed keys
|
||||
release_all_keys(&server, &mut emulation).await?;
|
||||
release_all_keys(server, &mut emulation).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -23,13 +23,12 @@ pub fn new(
|
||||
cancellation_token: CancellationToken,
|
||||
) -> JoinHandle<()> {
|
||||
// timer task
|
||||
let ping_task = tokio::task::spawn_local(async move {
|
||||
tokio::task::spawn_local(async move {
|
||||
tokio::select! {
|
||||
_ = cancellation_token.cancelled() => {}
|
||||
_ = ping_task(server, sender_ch, emulate_notify, capture_notify, timer_notify) => {}
|
||||
}
|
||||
});
|
||||
ping_task
|
||||
})
|
||||
}
|
||||
|
||||
async fn ping_task(
|
||||
|
||||
Reference in New Issue
Block a user