public class StringProtocol extends AbstractNettyProtocol
Modifier and Type | Field and Description |
---|---|
(package private) int |
frameSize
The maximum size of the incoming message in bytes.
|
private NulEncoder |
nulEncoder
Flash client expects a nul byte 0x00 to be added as the end byte of any
communication with it.
|
private org.jboss.netty.handler.codec.string.StringDecoder |
stringDecoder
Used to decode a netty
ChannelBuffer (actually a byte array) to a
string. |
private org.jboss.netty.handler.codec.string.StringEncoder |
stringEncoder
Used to encode a normal java String to a netty
ChannelBuffer
(actually a byte array). |
IDLE_CHECK_HANDLER, IDLE_STATE_CHECK_HANDLER
Constructor and Description |
---|
StringProtocol() |
StringProtocol(int frameSize,
NulEncoder nulEncoder,
org.jboss.netty.handler.codec.string.StringDecoder stringDecoder,
org.jboss.netty.handler.codec.string.StringEncoder stringEncoder) |
Modifier and Type | Method and Description |
---|---|
void |
applyProtocol(PlayerSession playerSession)
The main method of this interface.
|
int |
getFrameSize() |
NulEncoder |
getNulEncoder() |
org.jboss.netty.handler.codec.string.StringDecoder |
getStringDecoder() |
org.jboss.netty.handler.codec.string.StringEncoder |
getStringEncoder() |
void |
setFrameSize(int frameSize) |
void |
setNulEncoder(NulEncoder nulEncoder) |
void |
setStringDecoder(org.jboss.netty.handler.codec.string.StringDecoder stringDecoder) |
void |
setStringEncoder(org.jboss.netty.handler.codec.string.StringEncoder stringEncoder) |
applyProtocol, createLengthBasedFrameDecoder, getProtocolName
int frameSize
DelimiterBasedFrameDecoder
will use this value in order to throw
a TooLongFrameException
.private NulEncoder nulEncoder
private org.jboss.netty.handler.codec.string.StringDecoder stringDecoder
ChannelBuffer
(actually a byte array) to a
string.private org.jboss.netty.handler.codec.string.StringEncoder stringEncoder
ChannelBuffer
(actually a byte array).public StringProtocol()
public StringProtocol(int frameSize, NulEncoder nulEncoder, org.jboss.netty.handler.codec.string.StringDecoder stringDecoder, org.jboss.netty.handler.codec.string.StringEncoder stringEncoder)
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 int getFrameSize()
public void setFrameSize(int frameSize)
public NulEncoder getNulEncoder()
public void setNulEncoder(NulEncoder nulEncoder)
public org.jboss.netty.handler.codec.string.StringDecoder getStringDecoder()
public void setStringDecoder(org.jboss.netty.handler.codec.string.StringDecoder stringDecoder)
public org.jboss.netty.handler.codec.string.StringEncoder getStringEncoder()
public void setStringEncoder(org.jboss.netty.handler.codec.string.StringEncoder stringEncoder)
Copyright © 2013. All Rights Reserved.