public interface AioHandler
| 限定符和类型 | 方法和说明 |
|---|---|
Packet |
decode(ByteBuffer buffer,
int limit,
int position,
int readableLength,
ChannelContext channelContext)
根据ByteBuffer解码成业务需要的Packet对象.
|
ByteBuffer |
encode(Packet packet,
TioConfig tioConfig,
ChannelContext channelContext)
编码
|
void |
handler(Packet packet,
ChannelContext channelContext)
处理消息包
|
Packet decode(ByteBuffer buffer, int limit, int position, int readableLength, ChannelContext channelContext) throws AioDecodeException
buffer - 参与本次希望解码的ByteBufferlimit - ByteBuffer的limitposition - ByteBuffer的position,不一定是0哦readableLength - ByteBuffer参与本次解码的有效数据(= limit - position)channelContext - AioDecodeExceptionByteBuffer encode(Packet packet, TioConfig tioConfig, ChannelContext channelContext)
packet - tioConfig - channelContext - void handler(Packet packet, ChannelContext channelContext) throws Exception
packet - channelContext - ExceptionCopyright © 2019. All rights reserved.