diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client.rs | 10 | ||||
-rw-r--r-- | src/server.rs | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs index ab8fc2a..7e5680b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -330,6 +330,16 @@ impl Connection { } } + /// Set the default channel + pub fn set_default_channel(&mut self, channel_id: ChannelId) { + self.default_channel = Some(channel_id); + } + + /// Get the default Channel Id + pub fn get_default_channel(&self) -> Option<ChannelId> { + self.default_channel + } + fn create_channel(&mut self, channel_id: ChannelId) -> Result<ChannelId, QuinnetError> { let (bytes_to_channel_send, bytes_to_channel_recv) = mpsc::channel::<Bytes>(DEFAULT_MESSAGE_QUEUE_SIZE); diff --git a/src/server.rs b/src/server.rs index d73ded5..eda7d18 100644 --- a/src/server.rs +++ b/src/server.rs @@ -481,6 +481,16 @@ impl Endpoint { } } + /// Set the default channel + pub fn set_default_channel(&mut self, channel_id: ChannelId) { + self.default_channel = Some(channel_id); + } + + /// Get the default Channel Id + pub fn get_default_channel(&self) -> Option<ChannelId> { + self.default_channel + } + fn open_default_channels(&mut self) -> Result<ChannelId, QuinnetError> { self.open_channel(ChannelType::OrderedReliable)?; self.open_channel(ChannelType::UnorderedReliable)?; |