Example usage for io.netty.handler.codec.http2 Http2CodecUtil DEFAULT_WINDOW_SIZE

List of usage examples for io.netty.handler.codec.http2 Http2CodecUtil DEFAULT_WINDOW_SIZE

Introduction

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

Prototype

int DEFAULT_WINDOW_SIZE

To view the source code for io.netty.handler.codec.http2 Http2CodecUtil DEFAULT_WINDOW_SIZE.

Click Source Link

Usage

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

License:Apache License

@Test
public void transportTracer_windowSizeDefault() throws Exception {
    manualSetUp();/*from  ww  w .  j  a v a2s.co m*/
    TransportStats transportStats = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, transportStats.remoteFlowControlWindow);
    assertEquals(flowControlWindow, transportStats.localFlowControlWindow);
}

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

License:Apache License

@Test
public void transportTracer_windowSize() throws Exception {
    flowControlWindow = 1024 * 1024;/*www  .j  a va  2  s  .c om*/
    manualSetUp();
    TransportStats transportStats = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, transportStats.remoteFlowControlWindow);
    assertEquals(flowControlWindow, transportStats.localFlowControlWindow);
}

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

License:Apache License

@Test
public void transportTracer_windowUpdate_remote() throws Exception {
    manualSetUp();/* w  w w . j  a  v  a 2s  .  com*/
    TransportStats before = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, before.remoteFlowControlWindow);
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, before.localFlowControlWindow);

    ByteBuf serializedSettings = windowUpdate(0, 1000);
    channelRead(serializedSettings);
    TransportStats after = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE + 1000, after.remoteFlowControlWindow);
    assertEquals(flowControlWindow, after.localFlowControlWindow);
}

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

License:Apache License

@Test
public void transportTracer_windowUpdate_local() throws Exception {
    manualSetUp();/*w w w.  ja  va  2 s. c  o  m*/
    TransportStats before = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, before.remoteFlowControlWindow);
    assertEquals(flowControlWindow, before.localFlowControlWindow);

    // If the window size is below a certain threshold, netty will wait to apply the update.
    // Use a large increment to be sure that it exceeds the threshold.
    connection().local().flowController().incrementWindowSize(connection().connectionStream(),
            8 * Http2CodecUtil.DEFAULT_WINDOW_SIZE);

    TransportStats after = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, after.remoteFlowControlWindow);
    assertEquals(flowControlWindow + 8 * Http2CodecUtil.DEFAULT_WINDOW_SIZE,
            connection().local().flowController().windowSize(connection().connectionStream()));
}