接口 EventListener<T>

  • 所有已知实现类:
    EventListenerAdapter

    public interface EventListener<T>
    新的客户端连接上来监听
    作者:
    iotos
    • 方法详细资料

      • onDisconnect

        void onDisconnect​(TcpServerConnectionContext<T> ctx,
                          me.hekr.iotos.softgateway.network.common.CloseReason reason)
        客户端与服务端断开连接
        参数:
        ctx - 上下文
        reason - 关闭连接原因
      • onHeartbeatTimeout

        void onHeartbeatTimeout​(TcpServerConnectionContext<T> ctx,
                                java.time.LocalDateTime lastOccurTime,
                                int count)
        * 客户端不活跃(超过了设定的心跳超时时间)
        参数:
        ctx - 上下文
        lastOccurTime - 上次发生时间,如果是第一次,则为 null
        count - 连续发生次数,如果有数据进来就会被重置为0开始