From d3b8019227137853406891e2aa84e0c8a9e3c31c Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Thu, 5 Jan 2023 14:55:57 +0100 Subject: send acks --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index b6a6af6..1f0aca0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ use std::{ ops, sync::Arc, }; -use tokio::sync::{mpsc, Mutex, RwLock}; +use tokio::sync::{mpsc, watch, Mutex, RwLock}; pub const PROTO_ID: u32 = 0x4f457403; pub const UDP_PKT_SIZE: usize = 512; @@ -69,12 +69,13 @@ pub struct Pkt { pub type Error = error::Error; pub type InPkt = Result>, Error>; +type AckChan = (watch::Sender, watch::Receiver); #[derive(Debug)] pub struct RudpShare { pub id: u16, pub remote_id: RwLock, - pub ack_chans: Mutex>>, + pub ack_chans: Mutex>, udp_tx: S, } @@ -203,5 +204,7 @@ async fn main() -> io::Result<()> { } println!("disco"); + // close()ing rx is not needed because it has been consumed to the end + Ok(()) } -- cgit v1.2.3