public class FlashPolicyServerAioHandler extends Object implements ServerAioHandler
Modifier and Type | Field and Description |
---|---|
static String |
REQUEST_STR |
static byte[] |
RESPONSE_BYTES |
Constructor and Description |
---|
FlashPolicyServerAioHandler() |
Modifier and Type | Method and Description |
---|---|
FlashPolicyPacket |
decode(ByteBuffer buffer,
int limit,
int position,
int readableLength,
ChannelContext channelContext)
|
ByteBuffer |
encode(Packet packet,
TioConfig tioConfig,
ChannelContext channelContext)
编码
|
void |
handler(Packet packet,
ChannelContext channelContext)
处理消息
|
public static final String REQUEST_STR
public static byte[] RESPONSE_BYTES
public void handler(Packet packet, ChannelContext channelContext) throws Exception
handler
in interface AioHandler
Exception
public FlashPolicyPacket decode(ByteBuffer buffer, int limit, int position, int readableLength, ChannelContext channelContext) throws TioDecodeException
decode
in interface AioHandler
buffer
- channelContext
- limit
- ByteBuffer的limitposition
- ByteBuffer的position,不一定是0哦readableLength
- ByteBuffer参与本次解码的有效数据(= limit - position)TioDecodeException
AioDecodeException
public ByteBuffer encode(Packet packet, TioConfig tioConfig, ChannelContext channelContext)
AioHandler
encode
in interface AioHandler
packet
- tioConfig
- channelContext
- Copyright © 2021. All rights reserved.