/// Write data from the output buffer into the underlaying socket if the 
/// socket is writable.
Write data from the output buffer into the underlaying socket if the
socket is writable.
Write data from the output buffer into the underlaying socket if the socket is writable .
fn check_write_event<T: Handler>(
        &mut self, 
        event_loop: &mut EventLoop<T>, 
        event_set: EventSet) -> Result<()> {
        if event_set.is_writable() {
            if self.output_buffer.is_empty() {
                self.update_socket_events(event_loop);
                self.write_tout.clear();
            } else {
                let len = try_svc_io!(self.stream.write(
                    self.output_buffer.as_bytes()));
                if len > 0 {
                    //log_debug!(self.logger, "{} bytes written into session socket {:08x} (buffer size: {})", len, self.session_id, self.output_buffer.buffered());
                    self.output_buffer.drop(len);
                    self.write_tout.set(CONNECTION_TIMEOUT);
                }
            }
        }
        Ok(())
    }
fn check_write_event < T : Handler > ( & mut self , event_loop : & mut EventLoop < T > , event_set : EventSet ) -> Result < ( ) > { if event_set . is_writable ( ) { if self . output_buffer . is_empty ( ) { self . update_socket_events ( event_loop ) ; self . write_tout . clear ( ) ; } else { let len = try_svc_io ! ( self stream write ( self output_buffer as_bytes ( ) ) ) ; if len > 0 { //log_debug!(self.logger, "{} bytes written into session socket {:08x} (buffer size: {})", len, self.session_id, self.output_buffer.buffered()); self . output_buffer . drop ( len ) ; self . write_tout . set ( CONNECTION_TIMEOUT ) ; } } } Ok ( ( ) ) }
Write data from the output buffer into the underlaying socket if the
socket is writable.
Write data from the output buffer into the underlaying socket if the socket is writable .
&mut self
event_loop
&mut EventLoop<T>
event_set
EventSet