From f3f2023306880d81571870e5acec7b3c436324c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Mon, 11 May 2020 16:27:42 +0200 Subject: [PATCH] aquatic_ws: update comments --- aquatic_ws/src/lib/network.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aquatic_ws/src/lib/network.rs b/aquatic_ws/src/lib/network.rs index 8eb4cca..1dface2 100644 --- a/aquatic_ws/src/lib/network.rs +++ b/aquatic_ws/src/lib/network.rs @@ -165,7 +165,9 @@ pub fn run_socket_worker( } -/// FIXME: close channel if not closed? +/// FIXME: close ws if not closed? Would be good in some cases, like when +/// connection removed because token has wrapped back, and generally when the +/// reason for removal is not that ws is already closed. fn remove_connection_if_exists( poll: &mut Poll, connections: &mut ConnectionMap, @@ -392,12 +394,12 @@ pub fn run_handshake_and_read_messages( } +/// Read messages from channel, send to peers pub fn send_out_messages( out_message_receiver: ::flume::Drain<(ConnectionMeta, OutMessage)>, poll: &mut Poll, connections: &mut ConnectionMap, ){ - // Read messages from channel, send to peers for (meta, out_message) in out_message_receiver { let opt_connection = connections .get_mut(&meta.poll_token)