public class ChannelBufferProtocol extends AbstractNettyProtocol
ChannelPipeline. For out
going messages it will set the length using the LengthFieldPrepender
encoder. The binary packets it receives will be of the format
[OPCODE][LENGTH][PAYLOAD] will find this protocol the most useful.| Modifier and Type | Field and Description |
|---|---|
private EventDecoder |
eventDecoder |
private EventEncoder |
eventEncoder |
private io.netty.handler.codec.LengthFieldPrepender |
lengthFieldPrepender
Utility handler provided by netty to add the length of the outgoing
message to the message as a header.
|
private static org.slf4j.Logger |
LOG |
IDLE_STATE_CHECK_HANDLER| Constructor and Description |
|---|
ChannelBufferProtocol() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyProtocol(PlayerSession playerSession)
The main method of this interface.
|
EventDecoder |
getEventDecoder() |
EventEncoder |
getEventEncoder() |
io.netty.handler.codec.LengthFieldPrepender |
getLengthFieldPrepender() |
void |
setEventDecoder(EventDecoder eventDecoder) |
void |
setEventEncoder(EventEncoder eventEncoder) |
void |
setLengthFieldPrepender(io.netty.handler.codec.LengthFieldPrepender lengthFieldPrepender) |
applyProtocol, createLengthBasedFrameDecoder, getProtocolNameprivate static final org.slf4j.Logger LOG
private io.netty.handler.codec.LengthFieldPrepender lengthFieldPrepender
private EventDecoder eventDecoder
private EventEncoder eventEncoder
public void applyProtocol(PlayerSession playerSession)
ProtocolLoginHandler or whichever previous
handler was handling the message has cleared up the
ChannelPipeline object.playerSession - The user session for which the protocol handlers need to be
set.public io.netty.handler.codec.LengthFieldPrepender getLengthFieldPrepender()
public void setLengthFieldPrepender(io.netty.handler.codec.LengthFieldPrepender lengthFieldPrepender)
public EventDecoder getEventDecoder()
public void setEventDecoder(EventDecoder eventDecoder)
public EventEncoder getEventEncoder()
public void setEventEncoder(EventEncoder eventEncoder)
Copyright © 2013. All Rights Reserved.