io.vertx.core.http.HttpConnection.getWindowSize()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中io.vertx.core.http.HttpConnection.getWindowSize()方法的一些代码示例,展示了HttpConnection.getWindowSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpConnection.getWindowSize()方法的具体详情如下:
包路径:io.vertx.core.http.HttpConnection
类名称:HttpConnection
方法名:getWindowSize

HttpConnection.getWindowSize介绍

暂无

代码示例

代码示例来源:origin: eclipse-vertx/vert.x

@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();
}

代码示例来源:origin: io.vertx/vertx-core

@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();
}

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * @return the current connection window size or <code>-1</code> for HTTP/1.x
 */
public int getWindowSize() { 
 int ret = delegate.getWindowSize();
 return ret;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * @return the current connection window size or <code>-1</code> for HTTP/1.x
 */
public int getWindowSize() { 
 int ret = delegate.getWindowSize();
 return ret;
}

相关文章