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
public class WebSocket08FrameEncoder extends OneToOneEncoder
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
Fields Modifier and Type Field Description private static InternalLogger
logger
private boolean
maskPayload
private static byte
OPCODE_BINARY
private static byte
OPCODE_CLOSE
private static byte
OPCODE_CONT
private static byte
OPCODE_PING
private static byte
OPCODE_PONG
private static byte
OPCODE_TEXT
-
Constructor Summary
Constructors Constructor Description WebSocket08FrameEncoder(boolean maskPayload)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
encode(ChannelHandlerContext ctx, Channel channel, java.lang.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 Detail
-
logger
private static final InternalLogger logger
-
OPCODE_CONT
private static final byte OPCODE_CONT
- See Also:
- Constant Field Values
-
OPCODE_TEXT
private static final byte OPCODE_TEXT
- See Also:
- Constant Field Values
-
OPCODE_BINARY
private static final byte OPCODE_BINARY
- See Also:
- Constant Field Values
-
OPCODE_CLOSE
private static final byte OPCODE_CLOSE
- See Also:
- Constant Field Values
-
OPCODE_PING
private static final byte OPCODE_PING
- See Also:
- Constant Field Values
-
OPCODE_PONG
private static final byte OPCODE_PONG
- See Also:
- Constant Field Values
-
maskPayload
private final boolean maskPayload
-
-
Method Detail
-
encode
protected java.lang.Object encode(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg) throws java.lang.Exception
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:
java.lang.Exception
-
-