Http2FrameWriter that supports all frame types defined by the HTTP/2 specification.
| Modifier and Type | Field and Description |
|---|---|
| private final Http2HeadersEncoder | |
| private int | |
| private static final String | |
| private static final String | |
| private static final Buffer | ZERO_BUFFER
This buffer is allocated to the maximum size of the padding field, and filled with zeros. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | DefaultHttp2FrameWriter(Http2HeadersEncoder.
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements io. |
| public Http2FrameWriter. | configuration()
Implements io. Http2FrameWriter
|
| public Http2FrameSizePolicy | frameSizePolicy()
Implements io. Http2FrameSizePolicy for this Http2FrameWriter
|
| public Http2HeadersEncoder. | |
| public void | maxFrameSize(int max)
Implements io. |
| public int | maxFrameSize()
Implements io. |
| private static int | paddingBytes(int padding)
Returns the number of padding bytes that should be appended to the end of a frame. |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private Future | writeContinuationFrames(ChannelHandlerContext ctx, int streamId, Buffer headerBlock, Http2CodecUtil.
Writes as many continuation frames as needed until |
| public Future | writeData(ChannelHandlerContext
the context to use for writing. ctx, int the stream for which to send the frame. streamId, Buffer the payload of the frame. This will be released by this method. data, int 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. padding, boolean indicates if this is the last frame to be sent for the stream. endStream)Implements io. DATA frame to the remote endpoint.
|
| public Future | writeFrame(ChannelHandlerContext
the context to use for writing. ctx, byte the frame type identifier. frameType, int the stream for which to send the frame. streamId, Http2Flags the flags to write for this frame. flags, Buffer the payload to write for this frame. This will be released by this method. payload)Implements io. |
| public Future | writeGoAway(ChannelHandlerContext
the context to use for writing. ctx, int the last known stream of this endpoint. lastStreamId, long the error code, if the connection was abnormally terminated. errorCode, Buffer application-defined debug data. This will be released by this method. debugData)Implements io. |
| public Future | writeHeaders(ChannelHandlerContext
the context to use for writing. ctx, int the stream for which to send the frame. streamId, Http2Headers the headers to be sent. headers, int additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive). padding, boolean indicates if this is the last frame to be sent for the stream. endStream)Implements io. |
| public Future | writeHeaders(ChannelHandlerContext
the context to use for writing. ctx, int the stream for which to send the frame. streamId, Http2Headers the headers to be sent. headers, int the stream on which this stream should depend, or 0 if it should
depend on the connection. streamDependency, short the weight for this stream. weight, boolean whether this stream should be the exclusive dependant of its parent. exclusive, int additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive). padding, boolean indicates if this is the last frame to be sent for the stream. endStream)Implements io. |
| private Future | writeHeadersInternal(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, boolean hasPriority, int streamDependency, short weight, boolean exclusive)
|
| private static void | |
| public Future | writePing(ChannelHandlerContext
the context to use for writing. ctx, boolean indicates whether this is an ack of a PING frame previously received from the
remote endpoint. ack, long the payload of the frame. data)Implements io. |
| public Future | writePriority(ChannelHandlerContext
the context to use for writing. ctx, int the stream for which to send the frame. streamId, int the stream on which this stream should depend, or 0 if it should
depend on the connection. streamDependency, short the weight for this stream. weight, boolean whether this stream should be the exclusive dependant of its parent. exclusive)Implements io. |
| public Future | writePushPromise(ChannelHandlerContext
the context to use for writing. ctx, int the stream for which to send the frame. streamId, int the ID of the promised stream. promisedStreamId, Http2Headers the headers to be sent. headers, int additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive). padding)Implements io. |
| public Future | writeRstStream(ChannelHandlerContext
the context to use for writing. ctx, int the stream for which to send the frame. streamId, long the error code indicating the nature of the failure. errorCode)Implements io. |
| public Future | writeSettings(ChannelHandlerContext
the context to use for writing. ctx, Http2Settings the settings to be sent. settings)Implements io. |
| public Future | writeSettingsAck(ChannelHandlerContext
the context to use for writing. ctx)Implements io. |
| public Future | writeWindowUpdate(ChannelHandlerContext
the context to use for writing. ctx, int the stream for which to send the frame. streamId, int the number of bytes by which the local inbound flow control window
is increasing. windowSizeIncrement)Implements io. |
| headersEncoder | back to summary |
|---|---|
| private final Http2HeadersEncoder headersEncoder | |
| maxFrameSize | back to summary |
|---|---|
| private int maxFrameSize | |
| STREAM_DEPENDENCY | back to summary |
|---|---|
| private static final String STREAM_DEPENDENCY | |
| STREAM_ID | back to summary |
|---|---|
| private static final String STREAM_ID | |
| ZERO_BUFFER | back to summary |
|---|---|
| private static final Buffer ZERO_BUFFER This buffer is allocated to the maximum size of the padding field, and filled with zeros.
When padding is needed it can be taken as a slice of this buffer.
Users should call | |
| DefaultHttp2FrameWriter | back to summary |
|---|---|
| public DefaultHttp2FrameWriter() | |
| DefaultHttp2FrameWriter | back to summary |
|---|---|
| public DefaultHttp2FrameWriter(Http2HeadersEncoder. | |
| DefaultHttp2FrameWriter | back to summary |
|---|---|
| public DefaultHttp2FrameWriter(Http2HeadersEncoder. | |
| DefaultHttp2FrameWriter | back to summary |
|---|---|
| public DefaultHttp2FrameWriter(Http2HeadersEncoder headersEncoder) | |
| close | back to summary |
|---|---|
| public void close() Implements io. Doc from io. Closes this writer and frees any allocated resources.
| |
| configuration | back to summary |
|---|---|
| public Http2FrameWriter. Implements io. Doc from io. Get the configuration related elements for this
| |
| frameSizePolicy | back to summary |
|---|---|
| public Http2FrameSizePolicy frameSizePolicy() Implements io. Doc from io. Get the
| |
| headersConfiguration | back to summary |
|---|---|
| public Http2HeadersEncoder. Implements io. Doc from io. Get the
| |
| maxFrameSize | back to summary |
|---|---|
| public void maxFrameSize(int max) throws Http2Exception Implements io. Doc from io. Sets the maximum allowed frame size. Attempts to write frames longer than this maximum will fail.
This value is used to represent
SETTINGS_MAX_FRAME_SIZE. This method should
only be called by Netty (not users) as a result of a receiving a
| |
| maxFrameSize | back to summary |
|---|---|
| public int maxFrameSize() Implements io. Doc from io. Gets the maximum allowed frame size.
This value is used to represent
SETTINGS_MAX_FRAME_SIZE. The initial value
defined by the RFC is unlimited but enforcing a lower limit is generally permitted.
| |
| paddingBytes | back to summary |
|---|---|
| private static int paddingBytes(int padding) Returns the number of padding bytes that should be appended to the end of a frame. | |
| verifyErrorCode | back to summary |
|---|---|
| private static void verifyErrorCode(long errorCode) | |
| verifyStreamId | back to summary |
|---|---|
| private static void verifyStreamId(int streamId, String argumentName) | |
| verifyStreamOrConnectionId | back to summary |
|---|---|
| private static void verifyStreamOrConnectionId(int streamId, String argumentName) | |
| verifyWeight | back to summary |
|---|---|
| private static void verifyWeight(short weight) | |
| verifyWindowSizeIncrement | back to summary |
|---|---|
| private static void verifyWindowSizeIncrement(int windowSizeIncrement) | |
| writeContinuationFrames | back to summary |
|---|---|
| private Future Writes as many continuation frames as needed until | |
| writeData | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a
| |
| writeFrame | back to summary |
|---|---|
| public Future Implements io. Doc from io. Generic write method for any HTTP/2 frame. This allows writing of non-standard frames.
| |
| writeGoAway | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a GO_AWAY frame to the remote endpoint.
| |
| writeHeaders | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a HEADERS frame to the remote endpoint.
| |
| writeHeaders | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a HEADERS frame with priority specified to the remote endpoint.
| |
| writeHeadersInternal | back to summary |
|---|---|
| private Future | |
| writePaddingLength | back to summary |
|---|---|
| private static void writePaddingLength(Buffer buf, int padding) | |
| writePing | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a PING frame to the remote endpoint.
| |
| writePriority | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a PRIORITY frame to the remote endpoint.
| |
| writePushPromise | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a PUSH_PROMISE frame to the remote endpoint.
| |
| writeRstStream | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a RST_STREAM frame to the remote endpoint.
| |
| writeSettings | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a SETTINGS frame to the remote endpoint.
| |
| writeSettingsAck | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a SETTINGS acknowledgment to the remote endpoint.
| |
| writeWindowUpdate | back to summary |
|---|---|
| public Future Implements io. Doc from io. Writes a WINDOW_UPDATE frame to the remote endpoint.
| |