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

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

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

HttpConnection.goAway介绍

[英]Like #goAway(long,int) with a last stream id -1 which means to disallow any new stream creation.
[中]比如#goAway(long,int),最后一个流id为-1,这意味着不允许创建任何新的流。

代码示例

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

/**
 * Like {@link #goAway(long, int, Buffer)} with no buffer.
 */
@Fluent
default HttpConnection goAway(long errorCode, int lastStreamId) {
 return goAway(errorCode, lastStreamId, null);
}

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

switch (reqCount.getAndIncrement()) {
 case 0:
  req.connection().goAway(0);
  break;
 case 1:

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

/**
 * Like {@link #goAway(long, int)} with a last stream id {@code -1} which means to disallow any new stream creation.
 */
@Fluent
default HttpConnection goAway(long errorCode) {
 return goAway(errorCode, -1);
}

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

switch (reqCount.getAndIncrement()) {
 case 0:
  req.connection().goAway(0);
  break;
 case 1:

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

@Test
public void testSendingGoAwayDiscardsTheConnection() throws Exception {
 AtomicInteger reqCount = new AtomicInteger();
 server.requestHandler(req -> {
  switch (reqCount.getAndIncrement()) {
   case 0:
    req.response().setChunked(true).write("some-data");
    break;
   case 1:
    req.response().end();
    break;
   default:
    fail();
  }
 });
 startServer();
 client.getNow(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath",
  onSuccess(resp -> {
   resp.request().connection().goAway(0);
   client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp2 -> {
    testComplete();
   }).setTimeout(5000).exceptionHandler(this::fail).end();
  }));
 await();
}

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

/**
 * Like {@link #goAway(long, int, Buffer)} with no buffer.
 */
@Fluent
default HttpConnection goAway(long errorCode, int lastStreamId) {
 return goAway(errorCode, lastStreamId, null);
}

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

/**
 * Like {@link #goAway(long, int)} with a last stream id {@code -1} which means to disallow any new stream creation.
 */
@Fluent
default HttpConnection goAway(long errorCode) {
 return goAway(errorCode, -1);
}

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

/**
 * Like {@link io.vertx.rxjava.core.http.HttpConnection#goAway} with no buffer.
 * @param errorCode 
 * @param lastStreamId 
 * @return 
 */
public io.vertx.rxjava.core.http.HttpConnection goAway(long errorCode, int lastStreamId) { 
 delegate.goAway(errorCode, lastStreamId);
 return this;
}

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

/**
 * Like {@link io.vertx.rxjava.core.http.HttpConnection#goAway} with a last stream id <code>-1</code> which means to disallow any new stream creation.
 * @param errorCode 
 * @return 
 */
public io.vertx.rxjava.core.http.HttpConnection goAway(long errorCode) { 
 delegate.goAway(errorCode);
 return this;
}

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

/**
 * Like {@link io.vertx.rxjava.core.http.HttpConnection#goAway} with a last stream id <code>-1</code> which means to disallow any new stream creation.
 * @param errorCode 
 * @return 
 */
public io.vertx.rxjava.core.http.HttpConnection goAway(long errorCode) { 
 delegate.goAway(errorCode);
 return this;
}

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

/**
 * Like {@link io.vertx.rxjava.core.http.HttpConnection#goAway} with no buffer.
 * @param errorCode 
 * @param lastStreamId 
 * @return 
 */
public io.vertx.rxjava.core.http.HttpConnection goAway(long errorCode, int lastStreamId) { 
 delegate.goAway(errorCode, lastStreamId);
 return this;
}

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

@Test
public void testSendingGoAwayDiscardsTheConnection() throws Exception {
 AtomicInteger reqCount = new AtomicInteger();
 server.requestHandler(req -> {
  switch (reqCount.getAndIncrement()) {
   case 0:
    req.response().setChunked(true).write("some-data");
    break;
   case 1:
    req.response().end();
    break;
   default:
    fail();
  }
 });
 startServer();
 HttpClientRequest req1 = client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath");
 req1.handler(resp1 -> {
  req1.connection().goAway(0);
  client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath", resp2 -> {
   testComplete();
  }).setTimeout(5000).exceptionHandler(this::fail).end();
 }).end();
 await();
}

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

/**
 * Send a go away frame to the remote endpoint of the connection.
 * <p/>
 * <ul>
 *   <li>a  frame is sent to the to the remote endpoint with the <code>errorCode</code> and <code>debugData</code></li>
 *   <li>any stream created after the stream identified by <code>lastStreamId</code> will be closed</li>
 *   <li>for an  is different than <code>0</code> when all the remaining streams are closed this connection will be closed automatically</li>
 * </ul>
 * <p/>
 * This is not implemented for HTTP/1.x.
 * @param errorCode the  error code
 * @param lastStreamId the last stream id
 * @param debugData additional debug data sent to the remote endpoint
 * @return a reference to this, so the API can be used fluently
 */
public io.vertx.rxjava.core.http.HttpConnection goAway(long errorCode, int lastStreamId, io.vertx.rxjava.core.buffer.Buffer debugData) { 
 delegate.goAway(errorCode, lastStreamId, debugData.getDelegate());
 return this;
}

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

/**
 * Send a go away frame to the remote endpoint of the connection.
 * <p/>
 * <ul>
 *   <li>a  frame is sent to the to the remote endpoint with the <code>errorCode</code> and <code>debugData</code></li>
 *   <li>any stream created after the stream identified by <code>lastStreamId</code> will be closed</li>
 *   <li>for an  is different than <code>0</code> when all the remaining streams are closed this connection will be closed automatically</li>
 * </ul>
 * <p/>
 * This is not implemented for HTTP/1.x.
 * @param errorCode the  error code
 * @param lastStreamId the last stream id
 * @param debugData additional debug data sent to the remote endpoint
 * @return a reference to this, so the API can be used fluently
 */
public io.vertx.rxjava.core.http.HttpConnection goAway(long errorCode, int lastStreamId, io.vertx.rxjava.core.buffer.Buffer debugData) { 
 delegate.goAway(errorCode, lastStreamId, debugData.getDelegate());
 return this;
}

相关文章