public class WebSocket08FrameEncoder extends MessageToMessageEncoder<WebSocketFrame> implements WebSocketFrameEncoder
将网络套接字帧编码为有线协议版本8格式。 此代码从webbit分叉并修改。
ChannelHandler.Sharable
Constructor and Description |
---|
WebSocket08FrameEncoder(boolean maskPayload)
构造函数
|
Modifier and Type | Method and Description |
---|---|
protected void |
encode(ChannelHandlerContext ctx, WebSocketFrame msg, java.util.List<java.lang.Object> out)
从一条消息编码到另一条消息。
|
acceptOutboundMessage, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bind, close, connect, deregister, disconnect, flush, read, write
exceptionCaught, handlerAdded, handlerRemoved
public WebSocket08FrameEncoder(boolean maskPayload)
maskPayload
- Web套接字客户端必须将其设置为true才能屏蔽有效负载。
服务器实现必须将其设置为false。
protected void encode(ChannelHandlerContext ctx, WebSocketFrame msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageEncoder
encode
在课堂上
MessageToMessageEncoder<WebSocketFrame>
ctx
- 这MessageToMessageEncoder
所属的ChannelHandlerContext
msg
- 要编码到另一个的消息
out
- 应该添加编码味精的
List
需要做某种聚合
java.lang.Exception
- 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.