# File lib/network/connection.rb, line 75
  def handle_input
    buf = @sockio.read
    raise(EOFError) if !buf || buf.empty?
    buf = @pstack.filter_call(:filter_in,buf)
    if @server.service_io == :packetio ||
       @server.service_type == :client
      publish(buf)
    else
      @inbuffer << buf
      if @initdone  # Just let buffer fill until we indicate we're done
                    # negotiating.  Set by calling initdone from TelnetFilter
        while p = @inbuffer.index("\n")
          ln = @inbuffer.slice!(0..p).chop
          publish(ln)
        end
      end
    end
  rescue EOFError, Errno::ECONNRESET, Errno::ECONNABORTED
    @closing = true
    publish(:disconnected)
    unsubscribe_all
    log.info "(#{self.object_id}) Connection '#{@host}(#{@addr})' disconnecting"
    log.error $!
  rescue Exception
    @closing = true
    publish(:disconnected)
    unsubscribe_all
    log.error "(#{self.object_id}) Connection#handle_input disconnecting"
    log.error $!
  end