/// Read a message if the underlaying socket is readable and the input 
/// buffer is not already full. Return the number of bytes read.
Read a message if the underlaying socket is readable and the input
buffer is not already full. Return the number of bytes read.
Read a message if the underlaying socket is readable and the input buffer is not already full . Return the number of bytes read .
fn check_read_event<T: Handler>(
        &mut self, 
        event_loop: &mut EventLoop<T>, 
        event_set: EventSet) -> Result<usize> {
        if event_set.is_readable() {
            if !self.input_buffer.is_full() || event_set.is_hup() {
                let buffer = &mut *self.read_buffer;
                let len    = try_svc_io!(self.stream.read(buffer));
                self.input_buffer.write_all(&buffer[..len])
                    .unwrap();
                //log_debug!(self.logger, "{} bytes read from session socket {:08x} (buffer size: {})", len, self.session_id, self.input_buffer.buffered());
                return Ok(len);
            } else {
                self.update_socket_events(event_loop);
            }
        }
        Ok(0)
    }
fn check_read_event < T : Handler > ( & mut self , event_loop : & mut EventLoop < T > , event_set : EventSet ) -> Result < usize > { if event_set . is_readable ( ) { if ! self . input_buffer . is_full ( ) || event_set . is_hup ( ) { let buffer = & mut * self . read_buffer ; let len = try_svc_io ! ( self stream read ( buffer ) ) ; self . input_buffer . write_all ( & buffer [ .. len ] ) . unwrap ( ) ; //log_debug!(self.logger, "{} bytes read from session socket {:08x} (buffer size: {})", len, self.session_id, self.input_buffer.buffered()); return Ok ( len ) ; } else { self . update_socket_events ( event_loop ) ; } } Ok ( 0 ) }
Read a message if the underlaying socket is readable and the input
buffer is not already full.
Read a message if the underlaying socket is readable and the input buffer is not already full .
&mut self
event_loop
&mut EventLoop<T>
event_set
EventSet