Package io.netty.handler.codec.http2
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 TypeMethodDescriptionvoid
void
private void
cleanup()
Releases theclientPrefaceString
.void
decode
(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) void
Releases theclientPrefaceString
.boolean
Determine if the HTTP/2 connection preface been sent.private boolean
Decodes the client connection preface string from the input buffer.private void
Sends the HTTP/2 connection preface upon establishment of the connection, if not already sent.private boolean
Peeks at that the next frame in the buffer and verifies that it is a non-ackSETTINGS
frame.
-
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.BaseDecoder
Determine if the HTTP/2 connection preface been sent.- Overrides:
prefaceSent
in classHttp2ConnectionHandler.BaseDecoder
-
decode
- Specified by:
decode
in classHttp2ConnectionHandler.BaseDecoder
- Throws:
Exception
-
channelActive
- Overrides:
channelActive
in classHttp2ConnectionHandler.BaseDecoder
- Throws:
Exception
-
channelInactive
- Overrides:
channelInactive
in classHttp2ConnectionHandler.BaseDecoder
- Throws:
Exception
-
handlerRemoved
Releases theclientPrefaceString
. Any active streams will be left in the open.- Overrides:
handlerRemoved
in 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:
true
if 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-ackSETTINGS
frame.- Parameters:
in
- the inbound buffer.- Returns:
true
if the next frame is a non-ackSETTINGS
frame,false
if more data is required before we can determine the next frame type.- Throws:
Http2Exception
- thrown if the next frame is NOT a non-ackSETTINGS
frame.
-
sendPreface
Sends the HTTP/2 connection preface upon establishment of the connection, if not already sent.- Throws:
Exception
-