All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.feingto.iot.server.handler.mqtt.PingreqHandler Maven / Gradle / Ivy

There is a newer version: 1.2.5.RELEASE
Show newest version
package com.feingto.iot.server.handler.mqtt;

import com.feingto.iot.common.service.mqtt.MessageResponse;
import com.feingto.iot.server.handler.BaseMessageHandler;
import io.netty.channel.Channel;
import io.netty.handler.codec.mqtt.MqttMessageType;

/**
 * PING请求处理器
 *
 * @author longfei
 */
public class PingreqHandler extends BaseMessageHandler {
    public PingreqHandler() {
        super(MqttMessageType.PINGREQ);
    }

    @Override
    public void handle(Channel channel, Object object) {
        if (channel.isOpen() && channel.isActive() && channel.isWritable()) {
            // 返回pingresp消息
            MessageResponse.pingresp(channel);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy