public class WebSocket00FrameDecoder extends ReplayingDecoder<java.lang.Void> implements WebSocketFrameDecoder
ByteBuf
s解码为WebSocketFrame
s。
有关向您的HTTP服务器添加Web Socket支持的详细说明,请查看位于io.netty.example.http.websocket
包中的WebSocketServer示例。
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Constructor and Description |
---|
WebSocket00FrameDecoder() |
WebSocket00FrameDecoder(int maxFrameSize)
用指定的
maxFrameSize 创建一个
WebSocketFrameDecoder 的新实例。
|
Modifier and Type | Method and Description |
---|---|
protected void |
decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
解码从一个 ByteBuf 到另一个。
|
callDecode, checkpoint, checkpoint, state, state
actualReadableBytes, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
ensureNotSharable, handlerAdded, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
handlerAdded, handlerRemoved
public WebSocket00FrameDecoder()
public WebSocket00FrameDecoder(int maxFrameSize)
maxFrameSize
创建WebSocketFrameDecoder
的新实例。
如果客户端发送的帧大小大于maxFrameSize
,则该频道将被关闭。
maxFrameSize
- 解码的最大帧大小
protected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
ByteToMessageDecoder
decode
在课堂
ByteToMessageDecoder
ctx
- 这ByteToMessageDecoder
所属的ChannelHandlerContext
in
- 从中读取数据的ByteBuf
out
- 应该添加解码消息的
List
java.lang.Exception
- is thrown if an error occurs
Copyright © 2008–2018 The Netty Project. All rights reserved.