def add_packet(packet)
      raise MultiplexedSessionError, 'session is not ready' unless ready?
      raise ArgumentError, 'packet must be instance of Packet' unless packet.is_a?(Packet)

      super(packet)

      pop_all_frames.each {|f| @message_queue.enq f.as_bytes }
    end
def add_packet(packet)
      raise MultiplexedSessionError, 'session is not ready' unless ready?
      raise ArgumentError, 'packet must be instance of Packet' unless packet.is_a?(Packet)

      super(packet)

      pop_all_frames.each {|f| @message_queue.enq f.as_bytes }
    end
encodes a packet and adds the message(s) to the message queue.