def pop_frames
      protocols = @queues.keys
      idx = protocols.index next_protocol
      protocols = protocols[idx..-1] + protocols[0,idx]

      protocols.each do |id|
        frames = pop_frames_for_protocol id
        return frames unless frames.empty?
      end

      []
    end
def pop_frames
      protocols = @queues.keys
      idx = protocols.index next_protocol
      protocols = protocols[idx..-1] + protocols[0,idx]

      protocols.each do |id|
        frames = pop_frames_for_protocol id
        return frames unless frames.empty?
      end

      []
    end
Returns the frames for the next protocol up to protocol window size bytes.