提交 ae91a228 编写于 作者: 如梦技术's avatar 如梦技术 🐛

完善注释。

上级 25688b8e
......@@ -22,8 +22,6 @@ import org.tio.client.DefaultClientAioListener;
import org.tio.core.ChannelContext;
import org.tio.core.Tio;
import java.nio.charset.StandardCharsets;
/**
* mqtt 客户端监听器
*
......
......@@ -38,6 +38,10 @@ public class MqttClientConfig {
* 超时时间,t-io 配置,可为 null
*/
private Integer timeout;
/**
* Keep Alive (s)
*/
private Integer keepAliveSecs;
/**
* SSL配置
*/
......@@ -68,6 +72,10 @@ public class MqttClientConfig {
private String password = null;
/**
* 清除会话
* <p>
* false 表示如果订阅的客户机断线了,那么要保存其要推送的消息,如果其重新连接时,则将这些消息推送。
* true 表示消除,表示客户机是第一次连接,消息所以以前的连接信息。
* </p>
*/
private boolean cleanSession = true;
/**
......
......@@ -28,7 +28,13 @@ import java.util.Objects;
public final class MqttWillMessage {
private final String topic;
private final String message;
/**
* 遗嘱消息保留标志
*/
private final boolean retain;
/**
* 如果遗嘱标志被设置为 false,遗嘱 QoS 也必须设置为 0。 如果遗嘱标志被设置为 true,遗嘱 QoS 的值可以等于 0,1,2。
*/
private final MqttQoS qos;
private MqttWillMessage(String topic, String message, boolean retain, MqttQoS qos) {
......@@ -85,7 +91,7 @@ public final class MqttWillMessage {
}
public MqttWillMessage build() {
return new MqttWillMessage(topic, message, retain, qos);
return new MqttWillMessage(this.topic, this.message, this.retain, this.qos);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册