aboutsummaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client.rs b/src/client.rs
index 38176d0..a7b03a9 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -184,7 +184,11 @@ impl Client {
self.default_connection_id
}
- /// Close a specific connection. Removes it from the client. This may fail if no [Connection] if found for connection_id, or if the [Connection] is already closed.
+ /// Close a specific connection. Removes it from the client.
+ ///
+ /// Closign a connection immediately prevents new messages from being sent on the connection and signal it to closes all its background tasks. Before trully closing, the connection will wait for all buffered messages in all its opened channels to be properly sent according to their respective channel type.
+ ///
+ /// This may fail if no [Connection] if found for connection_id, or if the [Connection] is already closed.
pub fn close_connection(&mut self, connection_id: ConnectionId) -> Result<(), QuinnetError> {
match self.connections.remove(&connection_id) {
Some(mut connection) => {