From ee4128777bc5e2204e1a36fb3149ba752de9e58e Mon Sep 17 00:00:00 2001 From: Henauxg <19689618+Henauxg@users.noreply.github.com> Date: Wed, 16 Nov 2022 17:17:45 +0100 Subject: [client] Fix comments --- src/client.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/client.rs b/src/client.rs index 0a382bc..c415a2b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -132,11 +132,10 @@ pub struct Connection { receiver: mpsc::Receiver, close_sender: broadcast::Sender<()>, pub(crate) internal_receiver: mpsc::Receiver, - // pub(crate) internal_sender: mpsc::Sender, } impl Connection { - /// Disconnect the client. This does not send any message to the server, and simply closes all the connection tasks locally. + /// Closes this connection. This does not send any message to the server, and simply closes all the connection's tasks locally. pub fn disconnect(&mut self) -> Result<(), QuinnetError> { if self.is_connected() { if let Err(_) = self.close_sender.send(()) { @@ -193,12 +192,11 @@ impl Connection { #[derive(Resource)] pub struct Client { - // connections: HashMap, runtime: runtime::Handle, } impl Client { - /// Connect to a server with the given [ClientConfigurationData] and [CertificateVerificationMode] + /// Sapwn a connection to a server with the given [ConnectionConfiguration] and [CertificateVerificationMode] pub fn spawn_connection( &self, commands: &mut Commands, @@ -226,7 +224,6 @@ impl Client { receiver: from_server_receiver, close_sender: close_sender.clone(), internal_receiver: from_async_client, - // internal_sender: to_async_client, }) .id(); @@ -378,12 +375,6 @@ async fn connection_task(mut spawn_config: ConnectionSpawnConfig) { } } -fn create_client(mut commands: Commands, runtime: Res) { - commands.insert_resource(Client { - runtime: runtime.handle().clone(), - }); -} - // Receive messages from the async client tasks and update the sync client. fn update_sync_client( mut connection_events: EventWriter, @@ -434,6 +425,12 @@ fn update_sync_client( } } +fn create_client(mut commands: Commands, runtime: Res) { + commands.insert_resource(Client { + runtime: runtime.handle().clone(), + }); +} + pub struct QuinnetClientPlugin {} impl Default for QuinnetClientPlugin { -- cgit v1.2.3