Class Http2ConnectionHandler.PrefaceDecoder
java.lang.Object
io.netty.handler.codec.http2.Http2ConnectionHandler.BaseDecoder
io.netty.handler.codec.http2.Http2ConnectionHandler.PrefaceDecoder
- Enclosing class:
Http2ConnectionHandler
private final class Http2ConnectionHandler.PrefaceDecoder
extends Http2ConnectionHandler.BaseDecoder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprivate voidcleanup()Releases theclientPrefaceString.voiddecode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) voidReleases theclientPrefaceString.booleanDetermine if the HTTP/2 connection preface been sent.private booleanDecodes the client connection preface string from the input buffer.private voidSends the HTTP/2 connection preface upon establishment of the connection, if not already sent.private booleanPeeks at that the next frame in the buffer and verifies that it is a non-ackSETTINGSframe.
-
Field Details
-
clientPrefaceString
-
prefaceSent
private boolean prefaceSent
-
-
Constructor Details
-
PrefaceDecoder
PrefaceDecoder(ChannelHandlerContext ctx) throws Exception - Throws:
Exception
-
-
Method Details
-
prefaceSent
public boolean prefaceSent()Description copied from class:Http2ConnectionHandler.BaseDecoderDetermine if the HTTP/2 connection preface been sent.- Overrides:
prefaceSentin classHttp2ConnectionHandler.BaseDecoder
-
decode
- Specified by:
decodein classHttp2ConnectionHandler.BaseDecoder- Throws:
Exception
-
channelActive
- Overrides:
channelActivein classHttp2ConnectionHandler.BaseDecoder- Throws:
Exception
-
channelInactive
- Overrides:
channelInactivein classHttp2ConnectionHandler.BaseDecoder- Throws:
Exception
-
handlerRemoved
Releases theclientPrefaceString. Any active streams will be left in the open.- Overrides:
handlerRemovedin classHttp2ConnectionHandler.BaseDecoder- Throws:
Exception
-
cleanup
private void cleanup()Releases theclientPrefaceString. Any active streams will be left in the open. -
readClientPrefaceString
Decodes the client connection preface string from the input buffer.- Returns:
trueif processing of the client preface string is complete. Since client preface strings can only be received by servers, returns true immediately for client endpoints.- Throws:
Http2Exception
-
verifyFirstFrameIsSettings
Peeks at that the next frame in the buffer and verifies that it is a non-ackSETTINGSframe.- Parameters:
in- the inbound buffer.- Returns:
trueif the next frame is a non-ackSETTINGSframe,falseif more data is required before we can determine the next frame type.- Throws:
Http2Exception- thrown if the next frame is NOT a non-ackSETTINGSframe.
-
sendPreface
Sends the HTTP/2 connection preface upon establishment of the connection, if not already sent.- Throws:
Exception
-