def receive_frame(frame)
      validate_received_frame(frame)
      consume_recv_window(frame)

      case frame
      when Frame::Data then         receive_data(frame)
      when Frame::Headers then      receive_headers(frame)
      when Frame::Priority then     receive_priority(frame)
      when Frame::RstStream then    receive_rst_stream(frame)
      when Frame::WindowUpdate then receive_window_update(frame)
      when Frame::Continuation then receive_continuation(frame)
      when Frame::PushPromise then  receive_push_promise(frame)
      when Frame::Ping, Frame::Goaway, Frame::Settings
        raise RemoteConnectionError.new(:protocol_error) # stream_id MUST be 0x00
      else
        # MUST ignore unknown frame
      end
    rescue RemoteStreamError => e
      callback(:stream_error, e)
      send_immediately Frame::RstStream.new(id, e.http2_error_type)
      close
    end
def receive_frame(frame)
      validate_received_frame(frame)
      consume_recv_window(frame)

      case frame
      when Frame::Data then         receive_data(frame)
      when Frame::Headers then      receive_headers(frame)
      when Frame::Priority then     receive_priority(frame)
      when Frame::RstStream then    receive_rst_stream(frame)
      when Frame::WindowUpdate then receive_window_update(frame)
      when Frame::Continuation then receive_continuation(frame)
      when Frame::PushPromise then  receive_push_promise(frame)
      when Frame::Ping, Frame::Goaway, Frame::Settings
        raise RemoteConnectionError.new(:protocol_error) # stream_id MUST be 0x00
      else
        # MUST ignore unknown frame
      end
    rescue RemoteStreamError => e
      callback(:stream_error, e)
      send_immediately Frame::RstStream.new(id, e.http2_error_type)
      close
    end
Processes received frames for this stream. Internal use.
 @private