Example usage for io.netty.handler.codec.http2 Http2FrameSizePolicy maxFrameSize

List of usage examples for io.netty.handler.codec.http2 Http2FrameSizePolicy maxFrameSize

Introduction

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

Prototype

int maxFrameSize();

Source Link

Document

Gets the maximum allowed frame size.

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());
    }//from w ww. jav  a 2s .  c  o  m
    return settings;
}