类 EventListenerAdapter<T>
- java.lang.Object
-
- me.hekr.iotos.softgateway.network.tcp.listener.EventListenerAdapter<T>
-
- 所有已实现的接口:
EventListener<T>
public class EventListenerAdapter<T> extends Object implements EventListener<T>
如果不想实现所有事件监听,可以继承这个类- 作者:
- iotos
-
-
构造器概要
构造器 构造器 说明 EventListenerAdapter()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidexceptionCaught(TcpServerConnectionContext<T> ctx, Throwable t)异常处理voidonConnect(TcpServerConnectionContext<T> ctx)客户端与服务端建立连接voidonDisconnect(TcpServerConnectionContext<T> ctx, me.hekr.iotos.softgateway.network.common.CloseReason reason)客户端与服务端断开连接voidonHeartbeatTimeout(TcpServerConnectionContext<T> ctx, java.time.LocalDateTime lastOccurTime, int count)* 客户端不活跃(超过了设定的心跳超时时间)
-
-
-
方法详细资料
-
onConnect
public void onConnect(TcpServerConnectionContext<T> ctx)
从接口复制的说明:EventListener客户端与服务端建立连接- 指定者:
onConnect在接口中EventListener<T>- 参数:
ctx- Context
-
onDisconnect
public void onDisconnect(TcpServerConnectionContext<T> ctx, me.hekr.iotos.softgateway.network.common.CloseReason reason)
从接口复制的说明:EventListener客户端与服务端断开连接- 指定者:
onDisconnect在接口中EventListener<T>- 参数:
ctx- 上下文reason- 关闭连接原因
-
onHeartbeatTimeout
public void onHeartbeatTimeout(TcpServerConnectionContext<T> ctx, java.time.LocalDateTime lastOccurTime, int count)
从接口复制的说明:EventListener* 客户端不活跃(超过了设定的心跳超时时间)- 指定者:
onHeartbeatTimeout在接口中EventListener<T>- 参数:
ctx- 上下文lastOccurTime- 上次发生时间,如果是第一次,则为 nullcount- 连续发生次数,如果有数据进来就会被重置为0开始
-
exceptionCaught
public void exceptionCaught(TcpServerConnectionContext<T> ctx, Throwable t)
从接口复制的说明:EventListener异常处理- 指定者:
exceptionCaught在接口中EventListener<T>- 参数:
ctx- 上下文t- Throwable
-
-