@UnstableApi public class DefaultHttp2ConnectionDecoder extends java.lang.Object implements Http2ConnectionDecoder
Http2FrameListener
This class will read HTTP/2 frames and delegate the events to a Http2FrameListener
This interface enforces inbound flow control functionality through
Http2LocalFlowController
| 构造器和说明 |
|---|
DefaultHttp2ConnectionDecoder(Http2Connection connection,
Http2ConnectionEncoder encoder,
Http2FrameReader frameReader) |
DefaultHttp2ConnectionDecoder(Http2Connection connection,
Http2ConnectionEncoder encoder,
Http2FrameReader frameReader,
Http2PromisedRequestVerifier requestVerifier) |
DefaultHttp2ConnectionDecoder(Http2Connection connection,
Http2ConnectionEncoder encoder,
Http2FrameReader frameReader,
Http2PromisedRequestVerifier requestVerifier,
boolean autoAckSettings)
Create a new instance.
|
DefaultHttp2ConnectionDecoder(Http2Connection connection,
Http2ConnectionEncoder encoder,
Http2FrameReader frameReader,
Http2PromisedRequestVerifier requestVerifier,
boolean autoAckSettings,
boolean autoAckPing)
已过时。
|
DefaultHttp2ConnectionDecoder(Http2Connection connection,
Http2ConnectionEncoder encoder,
Http2FrameReader frameReader,
Http2PromisedRequestVerifier requestVerifier,
boolean autoAckSettings,
boolean autoAckPing,
boolean validateHeaders)
Create a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected long |
calculateMaxHeaderListSizeGoAway(long maxHeaderListSize)
Calculate the threshold in bytes which should trigger a
GO_AWAY if a set of headers exceeds this amount. |
void |
close() |
Http2Connection |
connection()
Provides direct access to the underlying connection.
|
void |
decodeFrame(ChannelHandlerContext ctx,
ByteBuf in,
java.util.List<java.lang.Object> out)
Called by the
Http2ConnectionHandler to decode the next frame from the input buffer. |
Http2LocalFlowController |
flowController()
Provides the local flow controller for managing inbound traffic.
|
Http2FrameListener |
frameListener()
Get the
Http2FrameListener which will be notified when frames are decoded. |
void |
frameListener(Http2FrameListener listener)
Set the
Http2FrameListener which will be notified when frames are decoded. |
void |
lifecycleManager(Http2LifecycleManager lifecycleManager)
Sets the lifecycle manager.
|
Http2Settings |
localSettings()
Gets the local settings for this endpoint of the HTTP/2 connection.
|
boolean |
prefaceReceived()
Indicates whether or not the first initial
SETTINGS frame was received from the remote endpoint. |
public DefaultHttp2ConnectionDecoder(Http2Connection connection, Http2ConnectionEncoder encoder, Http2FrameReader frameReader)
public DefaultHttp2ConnectionDecoder(Http2Connection connection, Http2ConnectionEncoder encoder, Http2FrameReader frameReader, Http2PromisedRequestVerifier requestVerifier)
public DefaultHttp2ConnectionDecoder(Http2Connection connection, Http2ConnectionEncoder encoder, Http2FrameReader frameReader, Http2PromisedRequestVerifier requestVerifier, boolean autoAckSettings)
connection - The Http2Connection associated with this decoder.encoder - The Http2ConnectionEncoder associated with this decoder.frameReader - Responsible for reading/parsing the raw frames. As opposed to this object which applies
h2 semantics on top of the frames.requestVerifier - Determines if push promised streams are valid.autoAckSettings - false to disable automatically applying and sending settings acknowledge frame.
The Http2ConnectionEncoder is expected to be an instance of Http2SettingsReceivedConsumer and
will apply the earliest received but not yet ACKed SETTINGS when writing the SETTINGS ACKs.
true to enable automatically applying and sending settings acknowledge frame.@Deprecated public DefaultHttp2ConnectionDecoder(Http2Connection connection, Http2ConnectionEncoder encoder, Http2FrameReader frameReader, Http2PromisedRequestVerifier requestVerifier, boolean autoAckSettings, boolean autoAckPing)
public DefaultHttp2ConnectionDecoder(Http2Connection connection, Http2ConnectionEncoder encoder, Http2FrameReader frameReader, Http2PromisedRequestVerifier requestVerifier, boolean autoAckSettings, boolean autoAckPing, boolean validateHeaders)
connection - The Http2Connection associated with this decoder.encoder - The Http2ConnectionEncoder associated with this decoder.frameReader - Responsible for reading/parsing the raw frames. As opposed to this object which applies
h2 semantics on top of the frames.requestVerifier - Determines if push promised streams are valid.autoAckSettings - false to disable automatically applying and sending settings acknowledge frame.
The Http2ConnectionEncoder is expected to be an instance of
Http2SettingsReceivedConsumer and will apply the earliest received but not yet
ACKed SETTINGS when writing the SETTINGS ACKs. true to enable automatically
applying and sending settings acknowledge frame.autoAckPing - false to disable automatically sending ping acknowledge frame. true to enable
automatically sending ping ack frame.public void lifecycleManager(Http2LifecycleManager lifecycleManager)
Http2ConnectionDecoderlifecycleManager 在接口中 Http2ConnectionDecoderpublic Http2Connection connection()
Http2ConnectionDecoderconnection 在接口中 Http2ConnectionDecoderpublic final Http2LocalFlowController flowController()
Http2ConnectionDecoderflowController 在接口中 Http2ConnectionDecoderpublic void frameListener(Http2FrameListener listener)
Http2ConnectionDecoderHttp2FrameListener which will be notified when frames are decoded.
This must be set before frames are decoded.
frameListener 在接口中 Http2ConnectionDecoderpublic Http2FrameListener frameListener()
Http2ConnectionDecoderHttp2FrameListener which will be notified when frames are decoded.frameListener 在接口中 Http2ConnectionDecoderpublic boolean prefaceReceived()
Http2ConnectionDecoderSETTINGS frame was received from the remote endpoint.prefaceReceived 在接口中 Http2ConnectionDecoderpublic void decodeFrame(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws Http2Exception
Http2ConnectionDecoderHttp2ConnectionHandler to decode the next frame from the input buffer.decodeFrame 在接口中 Http2ConnectionDecoderHttp2Exceptionpublic Http2Settings localSettings()
Http2ConnectionDecoderlocalSettings 在接口中 Http2ConnectionDecoderpublic void close()
close 在接口中 Http2ConnectionDecoderclose 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseableprotected long calculateMaxHeaderListSizeGoAway(long maxHeaderListSize)
GO_AWAY if a set of headers exceeds this amount.maxHeaderListSize - SETTINGS_MAX_HEADER_LIST_SIZE for the local
endpoint.GO_AWAY if a set of headers exceeds this amount.