Class StreamBufferingEncoder

    • Constructor Detail

      • StreamBufferingEncoder

        public StreamBufferingEncoder​(Http2ConnectionEncoder delegate,
                                      int initialMaxConcurrentStreams)
    • Method Detail

      • numBufferedStreams

        public int numBufferedStreams()
        Indicates the number of streams that are currently buffered, awaiting creation.
      • writeHeaders

        public io.netty.channel.ChannelFuture writeHeaders​(io.netty.channel.ChannelHandlerContext ctx,
                                                           int streamId,
                                                           Http2Headers headers,
                                                           int padding,
                                                           boolean endStream,
                                                           io.netty.channel.ChannelPromise promise)
        Description copied from interface: Http2FrameWriter
        Writes a HEADERS frame to the remote endpoint.
        Specified by:
        writeHeaders in interface Http2FrameWriter
        Overrides:
        writeHeaders in class DecoratingHttp2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        streamId - the stream for which to send the frame.
        headers - the headers to be sent.
        padding - additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
        endStream - indicates if this is the last frame to be sent for the stream.
        promise - the promise for the write.
        Returns:
        the future for the write. Section 10.5.1 states the following:
         The header block MUST be processed to ensure a consistent connection state, unless the connection is closed.
         
        If this call has modified the HPACK header state you MUST throw a connection error.

        If this call has NOT modified the HPACK header state you are free to throw a stream error.

      • writeHeaders

        public io.netty.channel.ChannelFuture writeHeaders​(io.netty.channel.ChannelHandlerContext ctx,
                                                           int streamId,
                                                           Http2Headers headers,
                                                           int streamDependency,
                                                           short weight,
                                                           boolean exclusive,
                                                           int padding,
                                                           boolean endOfStream,
                                                           io.netty.channel.ChannelPromise promise)
        Description copied from interface: Http2FrameWriter
        Writes a HEADERS frame with priority specified to the remote endpoint.
        Specified by:
        writeHeaders in interface Http2FrameWriter
        Overrides:
        writeHeaders in class DecoratingHttp2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        streamId - the stream for which to send the frame.
        headers - the headers to be sent.
        streamDependency - the stream on which this stream should depend, or 0 if it should depend on the connection.
        weight - the weight for this stream.
        exclusive - whether this stream should be the exclusive dependant of its parent.
        padding - additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
        endOfStream - indicates if this is the last frame to be sent for the stream.
        promise - the promise for the write.
        Returns:
        the future for the write. Section 10.5.1 states the following:
         The header block MUST be processed to ensure a consistent connection state, unless the connection is closed.
         
        If this call has modified the HPACK header state you MUST throw a connection error.

        If this call has NOT modified the HPACK header state you are free to throw a stream error.

      • writeRstStream

        public io.netty.channel.ChannelFuture writeRstStream​(io.netty.channel.ChannelHandlerContext ctx,
                                                             int streamId,
                                                             long errorCode,
                                                             io.netty.channel.ChannelPromise promise)
        Description copied from interface: Http2FrameWriter
        Writes a RST_STREAM frame to the remote endpoint.
        Specified by:
        writeRstStream in interface Http2FrameWriter
        Overrides:
        writeRstStream in class DecoratingHttp2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        streamId - the stream for which to send the frame.
        errorCode - the error code indicating the nature of the failure.
        promise - the promise for the write.
        Returns:
        the future for the write.
      • writeData

        public io.netty.channel.ChannelFuture writeData​(io.netty.channel.ChannelHandlerContext ctx,
                                                        int streamId,
                                                        io.netty.buffer.ByteBuf data,
                                                        int padding,
                                                        boolean endOfStream,
                                                        io.netty.channel.ChannelPromise promise)
        Description copied from interface: Http2DataWriter
        Writes a DATA frame to the remote endpoint. This will result in one or more frames being written to the context.
        Specified by:
        writeData in interface Http2DataWriter
        Overrides:
        writeData in class DecoratingHttp2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        streamId - the stream for which to send the frame.
        data - the payload of the frame. This will be released by this method.
        padding - additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive). A 1 byte padding is encoded as just the pad length field with value 0. A 256 byte padding is encoded as the pad length field with value 255 and 255 padding bytes appended to the end of the frame.
        endOfStream - indicates if this is the last frame to be sent for the stream.
        promise - the promise for the write.
        Returns:
        the future for the write.
      • writeSettingsAck

        public io.netty.channel.ChannelFuture writeSettingsAck​(io.netty.channel.ChannelHandlerContext ctx,
                                                               io.netty.channel.ChannelPromise promise)
        Description copied from interface: Http2FrameWriter
        Writes a SETTINGS acknowledgment to the remote endpoint.
        Specified by:
        writeSettingsAck in interface Http2FrameWriter
        Overrides:
        writeSettingsAck in class DecoratingHttp2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        promise - the promise for the write.
        Returns:
        the future for the write.