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 io.netty.handler.codec.string.StringDecoder |
stringDecoder
Used to decode a netty
ByteBuf (actually a byte array) to a
string. |
private io.netty.handler.codec.string.StringEncoder |
stringEncoder
Used to encode a normal java String to a netty
ByteBuf
(actually a byte array). |
IDLE_STATE_CHECK_HANDLER| Constructor and Description |
|---|
StringProtocol() |
StringProtocol(int frameSize,
NulEncoder nulEncoder,
io.netty.handler.codec.string.StringDecoder stringDecoder,
io.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() |
io.netty.handler.codec.string.StringDecoder |
getStringDecoder() |
io.netty.handler.codec.string.StringEncoder |
getStringEncoder() |
void |
setFrameSize(int frameSize) |
void |
setNulEncoder(NulEncoder nulEncoder) |
void |
setStringDecoder(io.netty.handler.codec.string.StringDecoder stringDecoder) |
void |
setStringEncoder(io.netty.handler.codec.string.StringEncoder stringEncoder) |
applyProtocol, createLengthBasedFrameDecoder, getProtocolNameint frameSize
DelimiterBasedFrameDecoder will use this value in order to throw
a TooLongFrameException.private NulEncoder nulEncoder
private io.netty.handler.codec.string.StringDecoder stringDecoder
ByteBuf (actually a byte array) to a
string.private io.netty.handler.codec.string.StringEncoder stringEncoder
ByteBuf
(actually a byte array).public StringProtocol()
public StringProtocol(int frameSize,
NulEncoder nulEncoder,
io.netty.handler.codec.string.StringDecoder stringDecoder,
io.netty.handler.codec.string.StringEncoder stringEncoder)
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 int getFrameSize()
public void setFrameSize(int frameSize)
public NulEncoder getNulEncoder()
public void setNulEncoder(NulEncoder nulEncoder)
public io.netty.handler.codec.string.StringDecoder getStringDecoder()
public void setStringDecoder(io.netty.handler.codec.string.StringDecoder stringDecoder)
public io.netty.handler.codec.string.StringEncoder getStringEncoder()
public void setStringEncoder(io.netty.handler.codec.string.StringEncoder stringEncoder)
Copyright © 2013. All Rights Reserved.