Class WebSocket08FrameEncoder
java.lang.Object
org.jboss.netty.handler.codec.oneone.OneToOneEncoder
org.jboss.netty.handler.codec.http.websocketx.WebSocket08FrameEncoder
- All Implemented Interfaces:
ChannelDownstreamHandler
,ChannelHandler
- Direct Known Subclasses:
WebSocket07FrameEncoder
,WebSocket13FrameEncoder
Encodes a web socket frame into wire protocol version 8 format. This code was forked from webbit and modified.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final InternalLogger
private final boolean
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
encode
(ChannelHandlerContext ctx, Channel channel, Object msg) Transforms the specified message into another message and return the transformed message.Methods inherited from class org.jboss.netty.handler.codec.oneone.OneToOneEncoder
doEncode, handleDownstream
-
Field Details
-
logger
-
OPCODE_CONT
private static final byte OPCODE_CONT- See Also:
-
OPCODE_TEXT
private static final byte OPCODE_TEXT- See Also:
-
OPCODE_BINARY
private static final byte OPCODE_BINARY- See Also:
-
OPCODE_CLOSE
private static final byte OPCODE_CLOSE- See Also:
-
OPCODE_PING
private static final byte OPCODE_PING- See Also:
-
OPCODE_PONG
private static final byte OPCODE_PONG- See Also:
-
maskPayload
private final boolean maskPayload
-
-
Constructor Details
-
WebSocket08FrameEncoder
public WebSocket08FrameEncoder(boolean maskPayload) Constructor- Parameters:
maskPayload
- Web socket clients must set this to true to mask payload. Server implementations must set this to false.
-
-
Method Details
-
encode
Description copied from class:OneToOneEncoder
Transforms the specified message into another message and return the transformed message. Note that you can not returnnull
, unlike you can inOneToOneDecoder.decode(ChannelHandlerContext, Channel, Object)
; you must return something, at leastChannelBuffers.EMPTY_BUFFER
.- Specified by:
encode
in classOneToOneEncoder
- Throws:
Exception
-