public class HttpClientUpgradeHandler extends HttpObjectAggregator implements ChannelOutboundHandler
| Modifier and Type | Class and Description |
|---|---|
static interface |
HttpClientUpgradeHandler.SourceCodec
最初在流水线中使用的源代码编解码器。
|
static interface |
HttpClientUpgradeHandler.UpgradeCodec
源可以升级到的编解码器。
|
static class |
HttpClientUpgradeHandler.UpgradeEvent
被触发以通知升级状态的用户事件。
|
ChannelHandler.Sharable| Constructor and Description |
|---|
HttpClientUpgradeHandler(HttpClientUpgradeHandler.SourceCodec sourceCodec, HttpClientUpgradeHandler.UpgradeCodec upgradeCodec, int maxContentLength)
构造客户端升级处理程序。
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise)
调用一次绑定操作。
|
void |
close(ChannelHandlerContext ctx, ChannelPromise promise)
一旦进行了密切的操作,就会被调用。
|
void |
connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
连接操作完成后调用。
|
protected void |
decode(ChannelHandlerContext ctx, HttpObject msg, java.util.List<java.lang.Object> out)
从一条消息解码到另一条消息。
|
void |
deregister(ChannelHandlerContext ctx, ChannelPromise promise)
一旦从当前注册的 EventLoop进行撤销注册操作,就会被调用。
|
void |
disconnect(ChannelHandlerContext ctx, ChannelPromise promise)
调用一次断开操作。
|
void |
flush(ChannelHandlerContext ctx)
调用一次冲洗操作。
|
void |
read(ChannelHandlerContext ctx)
|
void |
write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise)
一旦写入操作被调用,就调用它。
|
aggregate, beginAggregation, closeAfterContinueResponse, finishAggregation, handleOversizedMessage, ignoreContentAfterContinueResponse, isAggregated, isContentLengthInvalid, isContentMessage, isLastContentMessage, isStartMessage, newContinueResponseacceptInboundMessage, channelInactive, channelReadComplete, ctx, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponentschannelReadchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic HttpClientUpgradeHandler(HttpClientUpgradeHandler.SourceCodec sourceCodec, HttpClientUpgradeHandler.UpgradeCodec upgradeCodec, int maxContentLength)
sourceCodec - 最初使用的编解码器。
upgradeCodec - 客户端想要升级到的编解码器。
maxContentLength - 聚合内容的最大长度。
public void bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
bind在界面
ChannelOutboundHandler
ctx - 为其进行绑定操作的ChannelHandlerContext
localAddress - 它应该绑定的
SocketAddress
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
connect在界面
ChannelOutboundHandler
ctx - 为其进行连接操作的ChannelHandlerContext
remoteAddress - 它应该连接的
SocketAddress
localAddress - 用作连接源的
SocketAddress
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
disconnect接口
ChannelOutboundHandler
ctx - 为其进行断开操作的ChannelHandlerContext
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
close接口
ChannelOutboundHandler
ctx - 关闭操作的ChannelHandlerContext
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
EventLoop开始撤销注册操作,就会被调用。
deregister接口
ChannelOutboundHandler
ctx - 关闭操作的ChannelHandlerContext
promise - 操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void read(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandler
read在界面
ChannelOutboundHandler
java.lang.Exception
public void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
write在界面
ChannelOutboundHandler
ctx - 为其写入操作的ChannelHandlerContext
msg - 要写的消息
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void flush(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandler
flush接口
ChannelOutboundHandler
ctx - 进行冲洗操作的ChannelHandlerContext
java.lang.Exception - 发生错误时抛出
protected void decode(ChannelHandlerContext ctx, HttpObject msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageDecoder
decode在课堂上
MessageAggregator<HttpObject,HttpMessage,HttpContent,FullHttpMessage>
ctx - 这MessageToMessageDecoder属于的ChannelHandlerContext
msg - 解码到另一个的消息
out - 应该添加解码消息的
List
java.lang.Exception - 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.