public class WebSocketServerExtensionHandler extends ChannelDuplexHandler
ChannelHandler.Sharable
Constructor and Description |
---|
WebSocketServerExtensionHandler(WebSocketServerExtensionHandshaker... extensionHandshakers)
构造函数
|
Modifier and Type | Method and Description |
---|---|
void |
channelRead(ChannelHandlerContext ctx, java.lang.Object msg)
|
void |
write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise)
|
bind, close, connect, deregister, disconnect, flush, read
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public WebSocketServerExtensionHandler(WebSocketServerExtensionHandshaker... extensionHandshakers)
extensionHandshakers
- 按优先级顺序的扩展握手。
握手可以在回退配置中重复多次。
public void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
ChannelInboundHandlerAdapter
ChannelHandlerContext.fireChannelRead(Object)
转发到ChannelPipeline
中的下一个ChannelInboundHandler
。
子类可以重写此方法来更改行为。
channelRead
接口
ChannelInboundHandler
channelRead
在课程
ChannelInboundHandlerAdapter
java.lang.Exception
public void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelDuplexHandler
ChannelOutboundInvoker.write(Object, ChannelPromise)
转发到ChannelPipeline
中的下一个ChannelOutboundHandler
。
子类可以重写此方法来更改行为。
write
接口
ChannelOutboundHandler
write
在课堂上
ChannelDuplexHandler
ctx
- 为其写入操作的ChannelHandlerContext
msg
- 要写的消息
promise
- 在操作完成后通知ChannelPromise
java.lang.Exception
- 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.