public class WebSocket08FrameEncoder extends OneToOneEncoder
Encodes a web socket frame into wire protocol version 8 format. This code was forked from webbit and modified.
ChannelHandler.Sharable
Constructor and Description |
---|
WebSocket08FrameEncoder(boolean maskPayload)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected Object |
encode(ChannelHandlerContext ctx,
Channel channel,
Object msg)
Transforms the specified message into another message and return the
transformed message.
|
doEncode, handleDownstream
public WebSocket08FrameEncoder(boolean maskPayload)
maskPayload
- Web socket clients must set this to true to mask payload. Server implementations must set this to
false.protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception
OneToOneEncoder
null
, unlike
you can in OneToOneDecoder.decode(ChannelHandlerContext, Channel, Object)
;
you must return something, at least ChannelBuffers.EMPTY_BUFFER
.encode
in class OneToOneEncoder
Exception
Copyright © 2008-2016 The Netty Project. All Rights Reserved.