@UnstableApi
public interface Http2LifecycleManager
| Modifier and Type | Method and Description |
|---|---|
void |
closeStream(Http2Stream stream, ChannelFuture future)
关闭并停用给定的
stream 。
|
void |
closeStreamLocal(Http2Stream stream, ChannelFuture future)
关闭
stream的本地端。
|
void |
closeStreamRemote(Http2Stream stream, ChannelFuture future)
关闭
stream的远程端。
|
ChannelFuture |
goAway(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData, ChannelPromise promise)
如果
errorCode不是
Http2Error.NO_ERROR,则防止对等体创建流并关闭连接。
|
void |
onError(ChannelHandlerContext ctx, boolean outbound, java.lang.Throwable cause)
处理给定的错误。
|
ChannelFuture |
resetStream(ChannelHandlerContext ctx, int streamId, long errorCode, ChannelPromise promise)
确保重置由
streamId标识的流。
|
void closeStreamLocal(Http2Stream stream, ChannelFuture future)
stream - 溪流半封闭。
future - 见
closeStream(Http2Stream, ChannelFuture) 。
void closeStreamRemote(Http2Stream stream, ChannelFuture future)
stream - 溪流半封闭。
future - 见
closeStream(Http2Stream, ChannelFuture) 。
void closeStream(Http2Stream stream, ChannelFuture future)
stream 。
收听者也附加到future ,完成后,如果Http2Connection.numActiveStreams()为0,则基础信道将被关闭。
stream - 要关闭和停用的流。
future - 如果
Http2Connection.numActiveStreams()为0,则完成后,底层渠道将被关闭。
ChannelFuture resetStream(ChannelHandlerContext ctx, int streamId, long errorCode, ChannelPromise promise)
streamId标识的流。
如果我们的本地状态没有显示流已被重置,那么RST_STREAM将被发送给对等体。
如果我们的本地状态指示流已经被重置,则返回状态将指示成功,而不向对等体发送任何东西。
ctx - 必要时用于通信和缓冲区分配的上下文。
streamId - 要重置的流的标识符。
errorCode - 为什么此流正在重置的理由。
见Http2Error 。
promise - 用于指示此操作的返回状态。
RST_STREAM帧已经发送到对等体时将被认为是成功的。
如果流状态已经更新并且已经发送RST_STREAM帧,则返回状态可以立即指示成功。
ChannelFuture goAway(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData, ChannelPromise promise)
errorCode不是Http2Error.NO_ERROR,则阻止对等体创建流并关闭连接。
在此呼叫之后,不允许对等体创建任何新的流,并且本地端点将仅限于使用stream identifier <= lastStreamId创建流。
这可能会导致发送一个GO_AWAY帧(假设我们还没有发送一个Last-Stream-ID <= lastStreamId ),或者如果以前发送了GO_AWAY ,可能会返回成功。
ctx - 必要时用于通信和缓冲区分配的上下文。
lastStreamId - 本地端点声称它将接受的最后一个流。
errorCode - 关于连接关闭的理由。
见Http2Error 。
debugData - 用于诊断目的(不含语义值)。
promise - 用于指示此操作的返回状态。
GO_AWAY帧已经发送到对等体时将被认为是成功的。
如果流状态已经更新并且GO_AWAY帧已经发送,则返回状态可以立即指示成功。
void onError(ChannelHandlerContext ctx, boolean outbound, java.lang.Throwable cause)
ctx - 必要时用于通信和缓冲区分配的上下文。
outbound - true如果错误是由出站操作引起的,则对应的ChannelPromise也失败。
cause - 错误。
Copyright © 2008–2018 The Netty Project. All rights reserved.