Deprecated
use Http2FrameCodecBuilder together with Http2MultiplexHandler.
When a new stream is created, a new Channel is created for it. Applications send and
receive Http2StreamFrames on the created channel. ByteBufs cannot be processed by the channel;
all writes that reach the head of the pipeline must be an instance of Http2StreamFrame. Writes that reach
the head of the pipeline are processed directly by this handler and cannot be intercepted.
The child channel will be notified of user events that impact the stream, such as Http2GoAwayFrame and Http2ResetFrame, as soon as they occur. Although Http2GoAwayFrame and Http2ResetFrame signify that the remote is ignoring further
communication, closing of the channel is delayed until any inbound queue is drained with Channel#read(), which follows the default behavior of channels in Netty. Applications are
free to close the channel in response to such events if they don't have use for any queued
messages. Any connection level events like Http2SettingsFrame and Http2GoAwayFrame
will be processed internally and also propagated down the pipeline for other handlers to act on.
Outbound streams are supported via the Http2StreamChannelBootstrap.
ChannelConfig#setMaxMessagesPerRead(int) and ChannelConfig#setAutoRead(boolean) are supported.
Http2StreamFrames implement the ReferenceCounted interface, as they carry
reference counted objects (e.g. ByteBufs). The multiplex codec will call ReferenceCounted#retain()
before propagating a reference counted object through the pipeline, and thus an application handler needs to release
such an object after having consumed it. For more information on reference counting take a look at
https://netty.io/wiki/reference-counted-objects.html
EventLoop. Therefore, an active channel
does not map to an active HTTP/2 stream immediately. Only once a Http2HeadersFrame has been successfully sent
or received, does the channel map to an active HTTP/2 stream. In case it is not possible to open a new HTTP/2 stream
(i.e. due to the maximum number of active streams being exceeded), the child channel receives an exception
indicating the cause and is closed immediately thereafter.
ChannelHandlers are free to ignore the
channel's writability, in which case the excessive writes will be buffered by the parent channel. It's important to
note that only Http2DataFrames are subject to HTTP/2 flow control.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile ChannelHandlerContext | |
| private int | |
| private final ChannelHandler | |
| private boolean | |
| private final Queue | |
| private final ChannelHandler |
| Access | Constructor and Description |
|---|---|
| pack-priv | Http2MultiplexCodec(Http2ConnectionEncoder encoder, Http2ConnectionDecoder decoder, Http2Settings initialSettings, ChannelHandler inboundStreamHandler, ChannelHandler upgradeStreamHandler, boolean decoupleCloseAndGoAway, boolean flushPreface)
|
| ctx | back to summary |
|---|---|
| pack-priv volatile ChannelHandlerContext ctx | |
| idCount | back to summary |
|---|---|
| private int idCount | |
| inboundStreamHandler | back to summary |
|---|---|
| private final ChannelHandler inboundStreamHandler | |
| parentReadInProgress | back to summary |
|---|---|
| private boolean parentReadInProgress | |
| readCompletePendingQueue | back to summary |
|---|---|
| private final Queue<AbstractHttp2StreamChannel> readCompletePendingQueue | |
| upgradeStreamHandler | back to summary |
|---|---|
| private final ChannelHandler upgradeStreamHandler | |
| Http2MultiplexCodec | back to summary |
|---|---|
| pack-priv Http2MultiplexCodec(Http2ConnectionEncoder encoder, Http2ConnectionDecoder decoder, Http2Settings initialSettings, ChannelHandler inboundStreamHandler, ChannelHandler upgradeStreamHandler, boolean decoupleCloseAndGoAway, boolean flushPreface) | |
| channelRead | back to summary |
|---|---|
| public final void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelReadComplete | back to summary |
|---|---|
| public final void channelReadComplete(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Notifies any child streams of the read completion.
| |
| channelWritabilityChanged | back to summary |
|---|---|
| public final void channelWritabilityChanged(final ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| flush0 | back to summary |
|---|---|
| pack-priv final void flush0(ChannelHandlerContext ctx) | |
| handlerAdded0 | back to summary |
|---|---|
| public final void handlerAdded0(ChannelHandlerContext ctx) throws Exception Overrides io.
| |
| handlerRemoved0 | back to summary |
|---|---|
| public final void handlerRemoved0(ChannelHandlerContext ctx) throws Exception Overrides io. Doc from io. Gets called after the
| |
| newOutboundStream | back to summary |
|---|---|
| pack-priv final Http2StreamChannel newOutboundStream() | |
| onHttp2Frame | back to summary |
|---|---|
| pack-priv final void onHttp2Frame(ChannelHandlerContext ctx, Http2Frame frame) Overrides io.
| |
| onHttp2FrameStreamException | back to summary |
|---|---|
| pack-priv final void onHttp2FrameStreamException(ChannelHandlerContext ctx, Http2FrameStreamException cause) Overrides io.
| |
| onHttp2GoAwayFrame | back to summary |
|---|---|
| private void onHttp2GoAwayFrame(ChannelHandlerContext ctx, final Http2GoAwayFrame goAwayFrame) | |
| onHttp2StreamStateChanged | back to summary |
|---|---|
| pack-priv final void onHttp2StreamStateChanged(ChannelHandlerContext ctx, Http2FrameCodec. Overrides io.
| |
| onHttpClientUpgrade | back to summary |
|---|---|
| public void onHttpClientUpgrade() throws Http2Exception Overrides io. Doc from io. Handles the client-side (cleartext) upgrade from HTTP to HTTP/2. Reserves local stream 1 for the HTTP/2 response.
| |
| onUserEventTriggered | back to summary |
|---|---|
| pack-priv final void onUserEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception Overrides io.
| |
| processPendingReadCompleteQueue | back to summary |
|---|---|
| private void processPendingReadCompleteQueue() | |
| Access | Constructor and Description |
|---|---|
| pack-priv | Http2MultiplexCodecStreamChannel(Http2FrameCodec.
|
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | |
| protected boolean | |
| protected ChannelHandlerContext | parentContext()
Implements abstract io. |
| protected ChannelFuture |
| Http2MultiplexCodecStreamChannel | back to summary |
|---|---|
| pack-priv Http2MultiplexCodecStreamChannel(Http2FrameCodec. | |
| addChannelToReadCompletePendingQueue | back to summary |
|---|---|
| protected void addChannelToReadCompletePendingQueue() Implements abstract io.
| |
| flush0 | back to summary |
|---|---|
| protected void flush0(ChannelHandlerContext ctx) Overrides io.
| |
| isParentReadInProgress | back to summary |
|---|---|
| protected boolean isParentReadInProgress() Implements abstract io.
| |
| parentContext | back to summary |
|---|---|
| protected ChannelHandlerContext parentContext() Implements abstract io.
| |
| write0 | back to summary |
|---|---|
| protected ChannelFuture write0(ChannelHandlerContext ctx, Object msg) Overrides io.
| |