pub fn stop(&mut self) {
        if let Some(mut conn) = self.server_handle.take() {
            conn.abort();
            for conn in self.established_connections.iter() {
                let _ = self.disconnected_connections.sender.send(*conn.key());
            }
            self.established_connections.clear();
            self.recv_message_map.clear();

            while self.new_connections.receiver.try_recv().is_ok() {}
        }
    }
/// Disconnect all clients and stop listening for new ones
///
/// ## Notes
/// This operation is idempotent and will do nothing if you are not actively listening
Disconnect all clients and stop listening for new ones
Disconnect all clients and stop listening for new ones
pub fn stop(&mut self) {
        if let Some(mut conn) = self.server_handle.take() {
            conn.abort();
            for conn in self.established_connections.iter() {
                let _ = self.disconnected_connections.sender.send(*conn.key());
            }
            self.established_connections.clear();
            self.recv_message_map.clear();
            while self.new_connections.receiver.try_recv().is_ok() {}
        }
    }
pub fn stop ( & mut self ) { if let Some ( mut conn ) = self . server_handle . take ( ) { conn . abort ( ) ; for conn in self . established_connections . iter ( ) { let _ = self . disconnected_connections . sender . send ( * conn . key ( ) ) ; } self . established_connections . clear ( ) ; self . recv_message_map . clear ( ) ; while self . new_connections . receiver . try_recv ( ) . is_ok ( ) { } } }
Disconnect all clients and stop listening for new ones
Disconnect all clients and stop listening for new ones
&mut self
&mut self
notes
This operation is idempotent and will do nothing if you are not actively listening
This operation is idempotent and will do nothing if you are not actively listening