aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenauxg <19689618+Henauxg@users.noreply.github.com>2022-11-16 17:17:45 +0100
committerHenauxg <19689618+Henauxg@users.noreply.github.com>2022-11-16 17:17:45 +0100
commitee4128777bc5e2204e1a36fb3149ba752de9e58e (patch)
treef3de1acb4e0ba3ed3da73f90620ddeb7c7dd5306 /src
parent24169ff167f25313da628abe5581e95e916908d3 (diff)
[client] Fix comments
Diffstat (limited to 'src')
-rw-r--r--src/client.rs19
1 files changed, 8 insertions, 11 deletions
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<Bytes>,
close_sender: broadcast::Sender<()>,
pub(crate) internal_receiver: mpsc::Receiver<InternalAsyncMessage>,
- // pub(crate) internal_sender: mpsc::Sender<InternalSyncMessage>,
}
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<ConnectionId, Connection>,
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<AsyncRuntime>) {
- 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<ConnectionEvent>,
@@ -434,6 +425,12 @@ fn update_sync_client(
}
}
+fn create_client(mut commands: Commands, runtime: Res<AsyncRuntime>) {
+ commands.insert_resource(Client {
+ runtime: runtime.handle().clone(),
+ });
+}
+
pub struct QuinnetClientPlugin {}
impl Default for QuinnetClientPlugin {