Class DefaultHttp2FrameWriter

    • Method Detail

      • writeData

        public io.netty5.util.concurrent.Future<Void> writeData​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                int streamId,
                                                                io.netty5.buffer.Buffer data,
                                                                int padding,
                                                                boolean endStream)
        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
        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.
        endStream - indicates if this is the last frame to be sent for the stream.
        Returns:
        the future for the write.
      • writeHeaders

        public io.netty5.util.concurrent.Future<Void> writeHeaders​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                   int streamId,
                                                                   Http2Headers headers,
                                                                   int padding,
                                                                   boolean endStream)
        Description copied from interface: Http2FrameWriter
        Writes a HEADERS frame to the remote endpoint.
        Specified by:
        writeHeaders in interface Http2FrameWriter
        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.
        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.netty5.util.concurrent.Future<Void> writeHeaders​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                   int streamId,
                                                                   Http2Headers headers,
                                                                   int streamDependency,
                                                                   short weight,
                                                                   boolean exclusive,
                                                                   int padding,
                                                                   boolean endStream)
        Description copied from interface: Http2FrameWriter
        Writes a HEADERS frame with priority specified to the remote endpoint.
        Specified by:
        writeHeaders in interface Http2FrameWriter
        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).
        endStream - indicates if this is the last frame to be sent for the stream.
        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.

      • writePriority

        public io.netty5.util.concurrent.Future<Void> writePriority​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                    int streamId,
                                                                    int streamDependency,
                                                                    short weight,
                                                                    boolean exclusive)
        Description copied from interface: Http2FrameWriter
        Writes a PRIORITY frame to the remote endpoint.
        Specified by:
        writePriority in interface Http2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        streamId - the stream for which to send the frame.
        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.
        Returns:
        the future for the write.
      • writeRstStream

        public io.netty5.util.concurrent.Future<Void> writeRstStream​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                     int streamId,
                                                                     long errorCode)
        Description copied from interface: Http2FrameWriter
        Writes a RST_STREAM frame to the remote endpoint.
        Specified by:
        writeRstStream in interface Http2FrameWriter
        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.
        Returns:
        the future for the write.
      • writeSettings

        public io.netty5.util.concurrent.Future<Void> writeSettings​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                    Http2Settings settings)
        Description copied from interface: Http2FrameWriter
        Writes a SETTINGS frame to the remote endpoint.
        Specified by:
        writeSettings in interface Http2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        settings - the settings to be sent.
        Returns:
        the future for the write.
      • writeSettingsAck

        public io.netty5.util.concurrent.Future<Void> writeSettingsAck​(io.netty5.channel.ChannelHandlerContext ctx)
        Description copied from interface: Http2FrameWriter
        Writes a SETTINGS acknowledgment to the remote endpoint.
        Specified by:
        writeSettingsAck in interface Http2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        Returns:
        the future for the write.
      • writePing

        public io.netty5.util.concurrent.Future<Void> writePing​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                boolean ack,
                                                                long data)
        Description copied from interface: Http2FrameWriter
        Writes a PING frame to the remote endpoint.
        Specified by:
        writePing in interface Http2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        ack - indicates whether this is an ack of a PING frame previously received from the remote endpoint.
        data - the payload of the frame.
        Returns:
        the future for the write.
      • writePushPromise

        public io.netty5.util.concurrent.Future<Void> writePushPromise​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                       int streamId,
                                                                       int promisedStreamId,
                                                                       Http2Headers headers,
                                                                       int padding)
        Description copied from interface: Http2FrameWriter
        Writes a PUSH_PROMISE frame to the remote endpoint.
        Specified by:
        writePushPromise in interface Http2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        streamId - the stream for which to send the frame.
        promisedStreamId - the ID of the promised stream.
        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).
        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.

      • writeGoAway

        public io.netty5.util.concurrent.Future<Void> writeGoAway​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                  int lastStreamId,
                                                                  long errorCode,
                                                                  io.netty5.buffer.Buffer debugData)
        Description copied from interface: Http2FrameWriter
        Writes a GO_AWAY frame to the remote endpoint.
        Specified by:
        writeGoAway in interface Http2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        lastStreamId - the last known stream of this endpoint.
        errorCode - the error code, if the connection was abnormally terminated.
        debugData - application-defined debug data. This will be released by this method.
        Returns:
        the future for the write.
      • writeWindowUpdate

        public io.netty5.util.concurrent.Future<Void> writeWindowUpdate​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                        int streamId,
                                                                        int windowSizeIncrement)
        Description copied from interface: Http2FrameWriter
        Writes a WINDOW_UPDATE frame to the remote endpoint.
        Specified by:
        writeWindowUpdate in interface Http2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        streamId - the stream for which to send the frame.
        windowSizeIncrement - the number of bytes by which the local inbound flow control window is increasing.
        Returns:
        the future for the write.
      • writeFrame

        public io.netty5.util.concurrent.Future<Void> writeFrame​(io.netty5.channel.ChannelHandlerContext ctx,
                                                                 byte frameType,
                                                                 int streamId,
                                                                 Http2Flags flags,
                                                                 io.netty5.buffer.Buffer payload)
        Description copied from interface: Http2FrameWriter
        Generic write method for any HTTP/2 frame. This allows writing of non-standard frames.
        Specified by:
        writeFrame in interface Http2FrameWriter
        Parameters:
        ctx - the context to use for writing.
        frameType - the frame type identifier.
        streamId - the stream for which to send the frame.
        flags - the flags to write for this frame.
        payload - the payload to write for this frame. This will be released by this method.
        Returns:
        the future for the write.