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
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