aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgilles henaux <gill.henaux@gmail.com>2023-01-11 15:32:51 +0100
committergilles henaux <gill.henaux@gmail.com>2023-01-11 15:32:51 +0100
commit47a272b0ce880a51a8f4502dc72a6ed0926f94a5 (patch)
treec9db4c2ec506001363eb3d8fa0328e1eb819b400 /src
parent09890a11daeb3810dca5b3a30edede8a65a73257 (diff)
[channels] Rename OrdRelChannelId to MultiChannelId and remove commented code
Diffstat (limited to 'src')
-rw-r--r--src/client.rs4
-rw-r--r--src/shared/channel.rs25
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")
-// // }
-// }
-// }