package com.lutao.cloud.iot.mqtt.core.client;

import org.tio.core.ChannelContext;

/**
 * mqtt 客户端连接监听
 */
public interface IMqttClientConnectListener {

    /**
     * 监听到消息
     *
     * @param context     ChannelContext
     * @param isReconnect 是否重连
     */
    void onConnected(ChannelContext context, boolean isReconnect);

    /**
     * 连接关闭前触发本方法
     *
     * @param channelContext the channelContext
     * @param throwable      the throwable 有可能为空
     * @param remark         the remark 有可能为空
     * @param isRemove       is removed
     */
    void onDisconnect(ChannelContext channelContext, Throwable throwable, String remark, boolean isRemove);

}
