Class Http2ConnectionHandler.PrefaceDecoder

    • Field Detail

      • clientPrefaceString

        private ByteBuf clientPrefaceString
      • prefaceSent

        private boolean prefaceSent
    • Constructor Detail

      • PrefaceDecoder

        PrefaceDecoder​(ChannelHandlerContext ctx)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • cleanup

        private void cleanup()
        Releases the clientPrefaceString. Any active streams will be left in the open.
      • readClientPrefaceString

        private boolean readClientPrefaceString​(ByteBuf in)
                                         throws Http2Exception
        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

        private boolean verifyFirstFrameIsSettings​(ByteBuf in)
                                            throws Http2Exception
        Peeks at that the next frame in the buffer and verifies that it is a non-ack SETTINGS frame.
        Parameters:
        in - the inbound buffer.
        Returns:
        true if the next frame is a non-ack SETTINGS 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-ack SETTINGS frame.
      • sendPreface

        private void sendPreface​(ChannelHandlerContext ctx)
                          throws java.lang.Exception
        Sends the HTTP/2 connection preface upon establishment of the connection, if not already sent.
        Throws:
        java.lang.Exception