本文整理了Java中io.vertx.core.http.HttpConnection.goAwayHandler()
方法的一些代码示例,展示了HttpConnection.goAwayHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpConnection.goAwayHandler()
方法的具体详情如下:
包路径:io.vertx.core.http.HttpConnection
类名称:HttpConnection
方法名:goAwayHandler
[英]Set an handler called when a GOAWAY frame is received.
This is not implemented for HTTP/1.x.
[中]设置接收到GOAWAY帧时调用的处理程序。
这不是为HTTP/1实现的。十、
代码示例来源:origin: eclipse-vertx/vert.x
req.connectionHandler(conn -> {
AtomicInteger gaCount = new AtomicInteger();
conn.goAwayHandler(ga -> {
if (gaCount.getAndIncrement() == 0) {
client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp2 -> {
代码示例来源:origin: eclipse-vertx/vert.x
server.connectionHandler(conn -> {
if (serverStatus.getAndIncrement() == 0) {
conn.goAwayHandler(ga -> {
assertEquals(0, ga.getErrorCode());
assertEquals(1, serverStatus.getAndIncrement());
代码示例来源:origin: eclipse-vertx/vert.x
@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();
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* 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;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* 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;
}
代码示例来源:origin: io.vertx/vertx-core
req1.connectionHandler(conn -> {
AtomicInteger gaCount = new AtomicInteger();
conn.goAwayHandler(ga -> {
if (gaCount.getAndIncrement() == 0) {
client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp2 -> {
代码示例来源:origin: io.vertx/vertx-core
server.connectionHandler(conn -> {
if (serverStatus.getAndIncrement() == 0) {
conn.goAwayHandler(ga -> {
assertEquals(0, ga.getErrorCode());
assertEquals(1, serverStatus.getAndIncrement());
代码示例来源:origin: io.vertx/vertx-core
@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();
}
代码示例来源:origin: io.vertx/vertx-lang-groovy
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) {
内容来源于网络,如有侵权,请联系作者删除!