@Test public void testUpdateConnectionWindowSize() throws Exception { ServerBootstrap bootstrap = createH2Server((decoder, encoder) -> new Http2EventAdapter() { @Override public void onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement) throws Http2Exception { vertx.runOnContext(v -> { assertEquals(65535, windowSizeIncrement); testComplete(); }); } }); ChannelFuture s = bootstrap.bind(DEFAULT_HTTPS_HOST, DEFAULT_HTTPS_PORT).sync(); client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp -> { }).connectionHandler(conn -> { assertEquals(65535, conn.getWindowSize()); conn.setWindowSize(65535 + 10000); assertEquals(65535 + 10000, conn.getWindowSize()); conn.setWindowSize(65535 + 65535); assertEquals(65535 + 65535, conn.getWindowSize()); }).end(); await(); }
/** * Update the current connection wide window size to a new size. * <p/> * Increasing this value, gives better performance when several data streams are multiplexed * <p/> * This is not implemented for HTTP/1.x. * @param windowSize the new window size * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpConnection setWindowSize(int windowSize) { delegate.setWindowSize(windowSize); return this; }
/** * Update the current connection wide window size to a new size. * <p/> * Increasing this value, gives better performance when several data streams are multiplexed * <p/> * This is not implemented for HTTP/1.x. * @param windowSize the new window size * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpConnection setWindowSize(int windowSize) { delegate.setWindowSize(windowSize); return this; }
@Test public void testUpdateConnectionWindowSize() throws Exception { ServerBootstrap bootstrap = createH2Server((decoder, encoder) -> new Http2EventAdapter() { @Override public void onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement) throws Http2Exception { vertx.runOnContext(v -> { assertEquals(65535, windowSizeIncrement); testComplete(); }); } }); ChannelFuture s = bootstrap.bind(DEFAULT_HTTPS_HOST, DEFAULT_HTTPS_PORT).sync(); client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp -> { }).connectionHandler(conn -> { assertEquals(65535, conn.getWindowSize()); conn.setWindowSize(65535 + 10000); assertEquals(65535 + 10000, conn.getWindowSize()); conn.setWindowSize(65535 + 65535); assertEquals(65535 + 65535, conn.getWindowSize()); }).end(); await(); }