Example usage for io.netty.handler.codec.http2 Http2LocalFlowController windowSize

List of usage examples for io.netty.handler.codec.http2 Http2LocalFlowController windowSize

Introduction

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

Prototype

int windowSize(Http2Stream stream);

Source Link

Document

Get the portion of the flow control window for the given stream that is currently available for sending/receiving frames which are subject to flow control.

Usage

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

License:Apache License

@Test
public void connectionWindowShouldBeOverridden() throws Exception {
    flowControlWindow = 1048576; // 1MiB
    setUp();//ww w .  ja  v  a 2 s .com

    Http2Stream connectionStream = connection().connectionStream();
    Http2LocalFlowController localFlowController = connection().local().flowController();
    int actualInitialWindowSize = localFlowController.initialWindowSize(connectionStream);
    int actualWindowSize = localFlowController.windowSize(connectionStream);
    assertEquals(flowControlWindow, actualWindowSize);
    assertEquals(flowControlWindow, actualInitialWindowSize);
    assertEquals(1048576, actualWindowSize);
}

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

License:Apache License

@Test
public void connectionWindowShouldBeOverridden() throws Exception {
    flowControlWindow = 1048576; // 1MiB
    manualSetUp();// www . j a  va  2 s  .  co m

    Http2Stream connectionStream = connection().connectionStream();
    Http2LocalFlowController localFlowController = connection().local().flowController();
    int actualInitialWindowSize = localFlowController.initialWindowSize(connectionStream);
    int actualWindowSize = localFlowController.windowSize(connectionStream);
    assertEquals(flowControlWindow, actualWindowSize);
    assertEquals(flowControlWindow, actualInitialWindowSize);
}