def message_from_buffer_nonblock
      return nil if @buffer.empty?
      ret = nil
      begin
        ret, size = Message.new.unmarshall_buffer(@buffer)
        @buffer.slice!(0, size)
      rescue IncompleteBufferException
        # fall through, let ret be null
      end
      ret
    end
def message_from_buffer_nonblock
      return nil if @buffer.empty?
      ret = nil
      begin
        ret, size = Message.new.unmarshall_buffer(@buffer)
        @buffer.slice!(0, size)
      rescue IncompleteBufferException
        # fall through, let ret be null
      end
      ret
    end
FIXME: fix Main loop instead
 Get and remove one message from the buffer.
 Return the message or nil.