pub async fn disconnect(mut self) {
        if self.is_connected() {
            // Cleanly leave realm
            let _ = self.leave_realm().await;
            // Stop the eventloop and disconnect from server
            let _ = self.ctl_channel.send(Request::Shutdown);

            // Wait for return status from core
            match self.core_res.recv().await {
                Some(Err(e)) => error!("Error while shutting down : {:?}", e),
                None => error!("Core never sent a status after shutting down..."),
                _ => {}
            }
        }
    }
/// Cleanly closes a connection with the server
Cleanly closes a connection with the server
Cleanly closes a connection with the server
pub async fn disconnect(mut self) {
        if self.is_connected() {
            // Cleanly leave realm
            let _ = self.leave_realm().await;
            // Stop the eventloop and disconnect from server
            let _ = self.ctl_channel.send(Request::Shutdown);
            // Wait for return status from core
            match self.core_res.recv().await {
                Some(Err(e)) => error!("Error while shutting down : {:?}", e),
                None => error!("Core never sent a status after shutting down..."),
                _ => {}
            }
        }
    }
pub async fn disconnect ( mut self ) { if self . is_connected ( ) { // Cleanly leave realm let _ = self . leave_realm ( ) . await ; // Stop the eventloop and disconnect from server let _ = self . ctl_channel . send ( Request :: Shutdown ) ; // Wait for return status from core match self . core_res . recv ( ) . await { Some ( Err ( e ) ) => error ! ( " " e ) , None => error ! ( " " ) , _ => { } } } }
Cleanly closes a connection with the server
Cleanly closes a connection with the server
mut self