Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mica
mica-mqtt
提交
ae91a228
mica-mqtt
项目概览
mica
/
mica-mqtt
通知
71
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
mica-mqtt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ae91a228
编写于
9月 16, 2020
作者:
如梦技术
🐛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
✨
完善注释。
上级
25688b8e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
3 deletion
+15
-3
mica-mqtt-core/src/main/java/net/dreamlu/iot/mqtt/core/client/MqttClientAioListener.java
...t/dreamlu/iot/mqtt/core/client/MqttClientAioListener.java
+0
-2
mica-mqtt-core/src/main/java/net/dreamlu/iot/mqtt/core/client/MqttClientConfig.java
...va/net/dreamlu/iot/mqtt/core/client/MqttClientConfig.java
+8
-0
mica-mqtt-core/src/main/java/net/dreamlu/iot/mqtt/core/client/MqttWillMessage.java
...ava/net/dreamlu/iot/mqtt/core/client/MqttWillMessage.java
+7
-1
未找到文件。
mica-mqtt-core/src/main/java/net/dreamlu/iot/mqtt/core/client/MqttClientAioListener.java
浏览文件 @
ae91a228
...
...
@@ -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 客户端监听器
*
...
...
mica-mqtt-core/src/main/java/net/dreamlu/iot/mqtt/core/client/MqttClientConfig.java
浏览文件 @
ae91a228
...
...
@@ -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
;
/**
...
...
mica-mqtt-core/src/main/java/net/dreamlu/iot/mqtt/core/client/MqttWillMessage.java
浏览文件 @
ae91a228
...
...
@@ -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
(
t
opic
,
message
,
retain
,
qos
);
return
new
MqttWillMessage
(
t
his
.
topic
,
this
.
message
,
this
.
retain
,
this
.
qos
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录