diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client.rs | 4 | ||||
-rw-r--r-- | src/shared/channel.rs | 25 |
2 files changed, 4 insertions, 25 deletions
diff --git a/src/client.rs b/src/client.rs index 71aad51..89e594b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -31,7 +31,7 @@ use tokio_util::codec::{FramedRead, LengthDelimitedCodec}; use crate::shared::{ channel::{ ordered_reliable_channel_task, unordered_reliable_channel_task, Channel, ChannelId, - ChannelType, OrdRelChannelId, + ChannelType, MultiChannelId, }, AsyncRuntime, QuinnetError, DEFAULT_KILL_MESSAGE_QUEUE_SIZE, DEFAULT_MESSAGE_QUEUE_SIZE, }; @@ -152,7 +152,7 @@ pub struct Connection { state: ConnectionState, channels: HashMap<ChannelId, Channel>, default_channel: Option<ChannelId>, - last_gen_id: OrdRelChannelId, + last_gen_id: MultiChannelId, receiver: mpsc::Receiver<Bytes>, close_sender: broadcast::Sender<()>, diff --git a/src/shared/channel.rs b/src/shared/channel.rs index 54ad3d7..5c458bb 100644 --- a/src/shared/channel.rs +++ b/src/shared/channel.rs @@ -10,7 +10,7 @@ use tokio::sync::{ }; use tokio_util::codec::{FramedWrite, LengthDelimitedCodec}; -pub(crate) type OrdRelChannelId = u64; +pub(crate) type MultiChannelId = u64; #[derive(Debug, Copy, Clone)] pub enum ChannelType { @@ -21,7 +21,7 @@ pub enum ChannelType { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum ChannelId { - OrderedReliable(OrdRelChannelId), + OrderedReliable(MultiChannelId), UnorderedReliable, Unreliable, } @@ -132,24 +132,3 @@ async fn new_uni_frame_sender( .expect("Failed to open send stream"); FramedWrite::new(uni_sender, LengthDelimitedCodec::new()) } - -// async fn send_msg( -// // close_sender: &tokio::sync::broadcast::Sender<()>, -// to_sync_client: &mpsc::Sender<InternalAsyncMessage>, -// frame_send: &mut FramedWrite<SendStream, LengthDelimitedCodec>, -// msg_bytes: Bytes, -// ) { -// if let Err(err) = frame_send.send(msg_bytes).await { -// error!("Error while sending, {}", err); -// error!("Client seems disconnected, closing resources"); -// // Emit LostConnection to properly update the connection about its state. -// // Raise LostConnection event before emitting a close signal because we have no guarantee to continue this async execution after the close signal has been processed. -// to_sync_client -// .send(InternalAsyncMessage::LostConnection) -// .await -// .expect("Failed to signal connection lost to sync client"); -// // if let Err(_) = close_sender.send(()) { -// // error!("Failed to close all client streams & resources") -// // } -// } -// } |