public class ImServerAioListener extends Object implements org.tio.server.intf.ServerAioListener
| Constructor and Description |
|---|
ImServerAioListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onAfterConnected(org.tio.core.ChannelContext channelContext,
boolean isConnected,
boolean isReconnect)
建链后触发本方法,注:建链不一定成功,需要关注参数isConnected
|
void |
onAfterDecoded(org.tio.core.ChannelContext channelContext,
org.tio.core.intf.Packet packet,
int packetSize)
解码成功后触发本方法
|
void |
onAfterHandled(org.tio.core.ChannelContext channelContext,
org.tio.core.intf.Packet packet,
long cost)
处理一个消息包后
|
void |
onAfterReceivedBytes(org.tio.core.ChannelContext channelContext,
int receivedBytes)
接收到TCP层传过来的数据后
|
void |
onAfterSent(org.tio.core.ChannelContext channelContext,
org.tio.core.intf.Packet packet,
boolean isSentSuccess)
消息包发送之后触发本方法
|
void |
onBeforeClose(org.tio.core.ChannelContext channelContext,
Throwable throwable,
String remark,
boolean isRemove)
连接关闭前触发本方法
|
public void onAfterConnected(org.tio.core.ChannelContext channelContext,
boolean isConnected,
boolean isReconnect)
onAfterConnected in interface org.tio.core.intf.AioListenerchannelContext - isConnected - 是否连接成功,true:表示连接成功,false:表示连接失败isReconnect - 是否是重连, true: 表示这是重新连接,false: 表示这是第一次连接Exceptionpublic void onAfterSent(org.tio.core.ChannelContext channelContext,
org.tio.core.intf.Packet packet,
boolean isSentSuccess)
onAfterSent in interface org.tio.core.intf.AioListenerchannelContext - packet - isSentSuccess - true:发送成功,false:发送失败Exceptionpublic void onBeforeClose(org.tio.core.ChannelContext channelContext,
Throwable throwable,
String remark,
boolean isRemove)
onBeforeClose in interface org.tio.core.intf.AioListenerchannelContext - the channelcontextthrowable - the throwable 有可能为空remark - the remark 有可能为空isRemove - Exceptionpublic void onAfterDecoded(org.tio.core.ChannelContext channelContext,
org.tio.core.intf.Packet packet,
int packetSize)
throws Exception
onAfterDecoded in interface org.tio.core.intf.AioListenerchannelContext - packet - packetSize - Exceptionpublic void onAfterReceivedBytes(org.tio.core.ChannelContext channelContext,
int receivedBytes)
throws Exception
onAfterReceivedBytes in interface org.tio.core.intf.AioListenerchannelContext - receivedBytes - 本次接收了多少字节Exceptionpublic void onAfterHandled(org.tio.core.ChannelContext channelContext,
org.tio.core.intf.Packet packet,
long cost)
throws Exception
onAfterHandled in interface org.tio.core.intf.AioListenerchannelContext - packet - cost - 本次处理消息耗时,单位:毫秒ExceptionCopyright © 2018. All rights reserved.