/// Move all data from the session input buffer into the Arrow output 
/// buffer.
Move all data from the session input buffer into the Arrow output
buffer.
Move all data from the session input buffer into the Arrow output buffer .
fn flush_session(
        &mut self, 
        session_id: u32, 
        event_loop: &mut EventLoop<Self>) {
        if let Some(ctx) = self.sessions.get_mut(&session_id) {
            // avoid sending empty packets
            let len = if ctx.input_ready() {
                let data = ctx.input_buffer();
                let arrow_msg = ArrowMessage::new(
                    ctx.service_id, ctx.session_id, 
                    data);
                if self.output_buffer.is_empty() {
                    self.write_tout.set(CONNECTION_TIMEOUT);
                }
                arrow_msg.serialize(&mut self.output_buffer)
                    .unwrap();
                data.len()
            } else {
                0
            };
            ctx.drop_input_bytes(len, event_loop);
            self.stream.enable_socket_events(true, true, event_loop);
            //log_debug!(self.logger, "{} bytes moved from session {:08x} input buffer into the Arrow output buffer", len, session_id);
        }
    }
fn flush_session ( & mut self , session_id : u32 , event_loop : & mut EventLoop < Self > ) { if let Some ( ctx ) = self . sessions . get_mut ( & session_id ) { // avoid sending empty packets let len = if ctx . input_ready ( ) { let data = ctx . input_buffer ( ) ; let arrow_msg = ArrowMessage :: new ( ctx . service_id , ctx . session_id , data ) ; if self . output_buffer . is_empty ( ) { self . write_tout . set ( CONNECTION_TIMEOUT ) ; } arrow_msg . serialize ( & mut self . output_buffer ) . unwrap ( ) ; data . len ( ) } else { 0 } ; ctx . drop_input_bytes ( len , event_loop ) ; self . stream . enable_socket_events ( true , true , event_loop ) ; //log_debug!(self.logger, "{} bytes moved from session {:08x} input buffer into the Arrow output buffer", len, session_id); } }
Move all data from the session input buffer into the Arrow output
buffer.
Move all data from the session input buffer into the Arrow output buffer .
&mut self
session_id
u32
event_loop
&mut EventLoop<Self>