public class SimpleByteArrayProtocol extends AbstractNettyProtocol
Modifier and Type | Field and Description |
---|---|
private ByteArrayDecoder |
byteArrayDecoder
Used to retrieve the rest of the bytes after the length field is
stripped.
|
private ByteArrayToChannelBufferEncoder |
byteArrayToChannelBufferEncoder
Converts a byte array to a
ChannelBuffer while sending to the client. |
private org.jboss.netty.handler.codec.frame.LengthFieldPrepender |
lengthFieldPrepender
Utility handler provided by netty to add the length of the outgoing
message to the message as a header.
|
IDLE_CHECK_HANDLER, IDLE_STATE_CHECK_HANDLER
Constructor and Description |
---|
SimpleByteArrayProtocol() |
SimpleByteArrayProtocol(ByteArrayDecoder byteArrayDecoder,
org.jboss.netty.handler.codec.frame.LengthFieldPrepender lengthFieldPrepender) |
Modifier and Type | Method and Description |
---|---|
void |
applyProtocol(PlayerSession playerSession)
The main method of this interface.
|
ByteArrayDecoder |
getByteArrayDecoder() |
ByteArrayToChannelBufferEncoder |
getByteArrayToChannelBufferEncoder() |
org.jboss.netty.handler.codec.frame.LengthFieldPrepender |
getLengthFieldPrepender() |
void |
setByteArrayDecoder(ByteArrayDecoder byteArrayDecoder) |
void |
setByteArrayToChannelBufferEncoder(ByteArrayToChannelBufferEncoder byteArrayToChannelBufferEncoder) |
void |
setLengthFieldPrepender(org.jboss.netty.handler.codec.frame.LengthFieldPrepender lengthFieldPrepender) |
applyProtocol, createLengthBasedFrameDecoder, getProtocolName
private ByteArrayDecoder byteArrayDecoder
private ByteArrayToChannelBufferEncoder byteArrayToChannelBufferEncoder
ChannelBuffer
while sending to the client.private org.jboss.netty.handler.codec.frame.LengthFieldPrepender lengthFieldPrepender
public SimpleByteArrayProtocol()
public SimpleByteArrayProtocol(ByteArrayDecoder byteArrayDecoder, org.jboss.netty.handler.codec.frame.LengthFieldPrepender lengthFieldPrepender)
public void applyProtocol(PlayerSession playerSession)
Protocol
LoginHandler
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 ByteArrayDecoder getByteArrayDecoder()
public void setByteArrayDecoder(ByteArrayDecoder byteArrayDecoder)
public org.jboss.netty.handler.codec.frame.LengthFieldPrepender getLengthFieldPrepender()
public void setLengthFieldPrepender(org.jboss.netty.handler.codec.frame.LengthFieldPrepender lengthFieldPrepender)
public ByteArrayToChannelBufferEncoder getByteArrayToChannelBufferEncoder()
public void setByteArrayToChannelBufferEncoder(ByteArrayToChannelBufferEncoder byteArrayToChannelBufferEncoder)
Copyright © 2013. All Rights Reserved.