Example usage for io.netty.handler.codec.http2 Http2HeadersDecoder configuration

List of usage examples for io.netty.handler.codec.http2 Http2HeadersDecoder configuration

Introduction

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

Prototype

Configuration configuration();

Source Link

Document

Get the Configuration for this Http2HeadersDecoder

Usage

From source file:io.grpc.netty.FixedHttp2ConnectionDecoder.java

License:Apache License

@Override
public Http2Settings localSettings() {
    Http2Settings settings = new Http2Settings();
    Http2FrameReader.Configuration config = frameReader.configuration();
    Http2HeadersDecoder.Configuration headersConfig = config.headersConfiguration();
    Http2FrameSizePolicy frameSizePolicy = config.frameSizePolicy();
    settings.initialWindowSize(flowController().initialWindowSize());
    settings.maxConcurrentStreams(connection.remote().maxActiveStreams());
    settings.headerTableSize(headersConfig.maxHeaderTableSize());
    settings.maxFrameSize(frameSizePolicy.maxFrameSize());
    settings.maxHeaderListSize(headersConfig.maxHeaderListSize());
    if (!connection.isServer()) {
        // Only set the pushEnabled flag if this is a client endpoint.
        settings.pushEnabled(connection.local().allowPushTo());
    }/* w  ww  . ja  va  2 s. co m*/
    return settings;
}