public class ClusterTcpClientListener extends Object implements TioClientListener
| Constructor and Description |
|---|
ClusterTcpClientListener(ClusterApi clusterApi) |
| Modifier and Type | Method and Description |
|---|---|
void |
onAfterConnected(ChannelContext context,
boolean isConnected,
boolean isReconnect)
建链后触发本方法,注:建链不一定成功,需要关注参数isConnected
|
void |
onBeforeClose(ChannelContext context,
Throwable throwable,
String remark,
boolean isRemove)
连接关闭前触发本方法
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonAfterDecoded, onAfterHandled, onAfterReceivedBytes, onAfterSentpublic ClusterTcpClientListener(ClusterApi clusterApi)
public void onAfterConnected(ChannelContext context, boolean isConnected, boolean isReconnect) throws Exception
TioListeneronAfterConnected in interface TioListenercontext - ChannelContextisConnected - 是否连接成功,true:表示连接成功,false:表示连接失败isReconnect - 是否是重连, true: 表示这是重新连接,false: 表示这是第一次连接Exception - Exceptionpublic void onBeforeClose(ChannelContext context, Throwable throwable, String remark, boolean isRemove) throws Exception
TioListeneronBeforeClose in interface TioListenercontext - the ChannelContextthrowable - the throwable 有可能为空remark - the remark 有可能为空isRemove - isRemoveException - ExceptionCopyright © 2024. All rights reserved.