Example usage for io.netty.handler.codec.http2 Http2ConnectionDecoder connection

List of usage examples for io.netty.handler.codec.http2 Http2ConnectionDecoder connection

Introduction

In this page you can find the example usage for io.netty.handler.codec.http2 Http2ConnectionDecoder connection.

Prototype

Http2Connection connection();

Source Link

Document

Provides direct access to the underlying connection.

Usage

From source file:io.vertx.core.http.impl.VertxHttp2ConnectionHandlerBuilder.java

License:Open Source License

@Override
protected VertxHttp2ConnectionHandler<C> build(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder,
        Http2Settings initialSettings) throws Exception {
    if (isServer()) {
        if (useCompression) {
            encoder = new CompressorHttp2ConnectionEncoder(encoder, compressionLevel,
                    CompressorHttp2ConnectionEncoder.DEFAULT_WINDOW_BITS,
                    CompressorHttp2ConnectionEncoder.DEFAULT_MEM_LEVEL);
        }/*from   ww  w  .  j a  va2  s  . c o  m*/
        VertxHttp2ConnectionHandler<C> handler = new VertxHttp2ConnectionHandler<>(connectionMap, decoder,
                encoder, initialSettings, connectionFactory);
        if (useDecompression) {
            frameListener(new DelegatingDecompressorFrameListener(decoder.connection(), handler.connection));
        } else {
            frameListener(handler.connection);
        }
        return handler;
    } else {
        VertxHttp2ConnectionHandler<C> handler = new VertxHttp2ConnectionHandler<>(connectionMap, decoder,
                encoder, initialSettings, connectionFactory);
        if (useCompression) {
            frameListener(new DelegatingDecompressorFrameListener(decoder.connection(), handler.connection));
        } else {
            frameListener(handler.connection);
        }
        return handler;
    }
}