@Test public void testInitialMaxConcurrentStreamZero() throws Exception { server.close(); server = vertx.createHttpServer(createBaseServerOptions().setInitialSettings(new Http2Settings().setMaxConcurrentStreams(0))); server.requestHandler(req -> { req.response().end(); }); server.connectionHandler(conn -> { vertx.setTimer(500, id -> { conn.updateSettings(new Http2Settings().setMaxConcurrentStreams(10)); }); }); startServer(); client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp -> { testComplete(); }).connectionHandler(conn -> { assertEquals(10, conn.remoteSettings().getMaxConcurrentStreams()); }).setTimeout(10000).exceptionHandler(this::fail).end(); await(); }
}); }).connectionHandler(conn -> { io.vertx.core.http.Http2Settings initialRemoteSettings = conn.remoteSettings(); assertEquals(initialSettings.isPushEnabled(), initialRemoteSettings.isPushEnabled()); assertEquals(initialSettings.getMaxHeaderListSize(), initialRemoteSettings.getMaxHeaderListSize());
}); }).connectionHandler(conn -> { io.vertx.core.http.Http2Settings initialRemoteSettings = conn.remoteSettings(); assertEquals(initialSettings.isPushEnabled(), initialRemoteSettings.isPushEnabled()); assertEquals(initialSettings.getMaxHeaderListSize(), initialRemoteSettings.getMaxHeaderListSize());
client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp -> { }).connectionHandler(conn -> { assertEquals(max == null ? 0xFFFFFFFFL : max, conn.remoteSettings().getMaxConcurrentStreams()); latch.countDown(); }).exceptionHandler(err -> {
/** * @return the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x */ public Http2Settings remoteSettings() { Http2Settings ret = delegate.remoteSettings(); return ret; }
/** * @return the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x */ public Http2Settings remoteSettings() { Http2Settings ret = delegate.remoteSettings(); return ret; }
public static java.util.Map<String, Object> remoteSettings(io.vertx.core.http.HttpConnection j_receiver) { return j_receiver.remoteSettings() != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(j_receiver.remoteSettings().toJson()) : null; } public static io.vertx.core.http.HttpConnection remoteSettingsHandler(io.vertx.core.http.HttpConnection j_receiver, io.vertx.core.Handler<java.util.Map<String, Object>> handler) {
client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp -> { }).connectionHandler(conn -> { assertEquals(max == null ? 0xFFFFFFFFL : max, conn.remoteSettings().getMaxConcurrentStreams()); latch.countDown(); }).exceptionHandler(err -> {
@Test public void testInitialMaxConcurrentStreamZero() throws Exception { server.close(); server = vertx.createHttpServer(createBaseServerOptions().setInitialSettings(new Http2Settings().setMaxConcurrentStreams(0))); server.requestHandler(req -> { req.response().end(); }); server.connectionHandler(conn -> { vertx.setTimer(500, id -> { conn.updateSettings(new Http2Settings().setMaxConcurrentStreams(10)); }); }); startServer(); client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp -> { testComplete(); }).connectionHandler(conn -> { assertEquals(10, conn.remoteSettings().getMaxConcurrentStreams()); }).setTimeout(10000).exceptionHandler(this::fail).end(); await(); }