req.connectionHandler(conn -> { AtomicInteger gaCount = new AtomicInteger(); conn.goAwayHandler(ga -> { if (gaCount.getAndIncrement() == 0) { client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp2 -> {
server.connectionHandler(conn -> { if (serverStatus.getAndIncrement() == 0) { conn.goAwayHandler(ga -> { assertEquals(0, ga.getErrorCode()); assertEquals(1, serverStatus.getAndIncrement());
@Test public void testServerShutdownConnection() throws Exception { waitFor(2); server.connectionHandler(HttpConnection::shutdown); server.requestHandler(req -> fail()); startServer(); AtomicInteger count = new AtomicInteger(); HttpClientRequest req1 = client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", onFailure(err -> { if (count.getAndIncrement() == 0) { complete(); } })); req1.connectionHandler(conn -> { Context ctx = Vertx.currentContext(); conn.goAwayHandler(ga -> { assertOnIOContext(ctx); complete(); }); }); req1.end(); await(); }
/** * Set an handler called when a frame is received. * <p/> * This is not implemented for HTTP/1.x. * @param handler the handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpConnection goAwayHandler(Handler<GoAway> handler) { delegate.goAwayHandler(handler); return this; }
/** * Set an handler called when a frame is received. * <p/> * This is not implemented for HTTP/1.x. * @param handler the handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpConnection goAwayHandler(Handler<GoAway> handler) { delegate.goAwayHandler(handler); return this; }
req1.connectionHandler(conn -> { AtomicInteger gaCount = new AtomicInteger(); conn.goAwayHandler(ga -> { if (gaCount.getAndIncrement() == 0) { client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp2 -> {
server.connectionHandler(conn -> { if (serverStatus.getAndIncrement() == 0) { conn.goAwayHandler(ga -> { assertEquals(0, ga.getErrorCode()); assertEquals(1, serverStatus.getAndIncrement());
@Test public void testServerShutdownConnection() throws Exception { waitFor(2); server.connectionHandler(HttpConnection::shutdown); server.requestHandler(req -> fail()); startServer(); HttpClientRequest req1 = client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath"); req1.connectionHandler(conn -> { Context ctx = Vertx.currentContext(); conn.goAwayHandler(ga -> { assertOnIOContext(ctx); complete(); }); }); AtomicInteger count = new AtomicInteger(); req1.exceptionHandler(err -> { if (count.getAndIncrement() == 0) { complete(); } }); req1.handler(resp -> { fail(); }); req1.end(); await(); }
public static io.vertx.core.http.HttpConnection goAwayHandler(io.vertx.core.http.HttpConnection j_receiver, io.vertx.core.Handler<java.util.Map<String, Object>> handler) { io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.goAwayHandler(handler != null ? event -> handler.handle(event != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(event.toJson()) : null) : null)); return j_receiver; } public static java.util.Map<String, Object> settings(io.vertx.core.http.HttpConnection j_receiver) {