/// Process a Control Protocol message.
Process a Control Protocol message.
Process a Control Protocol message .
fn process_control_message(
        &mut self, 
        event_loop: &mut EventLoop<Self>) -> SocketEventResult {
        let (header, body) = try_arr!(self.parse_control_message());
        log_debug!(self.logger, "received control message: {:?}", header.message_type());
        let res = match header.message_type() {
            ControlMessageType::ACK => 
                self.process_ack_message(header.msg_id, &body, event_loop),
            ControlMessageType::PING =>
                self.process_ping_message(header.msg_id, event_loop),
            ControlMessageType::REDIRECT =>
                self.process_redirect_message(&body),
            ControlMessageType::HUP =>
                self.process_hup_message(&body, event_loop),
            ControlMessageType::RESET_SVC_TABLE =>
                self.process_command(Command::ResetServiceTable),
            ControlMessageType::SCAN_NETWORK =>
                self.process_command(Command::ScanNetwork),
            ControlMessageType::GET_STATUS =>
                self.process_status_request(header.msg_id, event_loop),
            ControlMessageType::GET_SCAN_REPORT =>
                self.process_scan_report_request(header.msg_id, event_loop),
            mt => Err(ArrowError::other(format!("cannot handle Control Protocol message type: {:?}", mt)))
        };
        self.req_parser.clear();
        res
    }
fn process_control_message ( & mut self , event_loop : & mut EventLoop < Self > ) -> SocketEventResult { let ( header , body ) = try_arr ! ( self parse_control_message ( ) ) ; log_debug ! ( self logger " " header message_type ( ) ) ; let res = match header . message_type ( ) { ControlMessageType :: ACK => self . process_ack_message ( header . msg_id , & body , event_loop ) , ControlMessageType :: PING => self . process_ping_message ( header . msg_id , event_loop ) , ControlMessageType :: REDIRECT => self . process_redirect_message ( & body ) , ControlMessageType :: HUP => self . process_hup_message ( & body , event_loop ) , ControlMessageType :: RESET_SVC_TABLE => self . process_command ( Command :: ResetServiceTable ) , ControlMessageType :: SCAN_NETWORK => self . process_command ( Command :: ScanNetwork ) , ControlMessageType :: GET_STATUS => self . process_status_request ( header . msg_id , event_loop ) , ControlMessageType :: GET_SCAN_REPORT => self . process_scan_report_request ( header . msg_id , event_loop ) , mt => Err ( ArrowError :: other ( format ! ( " " mt ) ) ) } ; self . req_parser . clear ( ) ; res }
Process a Control Protocol message.
Process a Control Protocol message .
&mut self
event_loop
&mut EventLoop<Self>