public class MqttConnectionOptions extends Object
MqttClient 消息发布订阅客户端以及 MqttSyncClient 同步请求客户端。MqttClient message publishing and subscription client and the MqttSyncClient synchronization request client.| 限定符和类型 | 字段和说明 |
|---|---|
boolean |
CleanSession
是否清理会话,如果清理会话(CleanSession)标志被设置为1,客户端和服务端必须丢弃之前的任何会话并开始一个新的会话。
|
String |
ClientId
客户端的id的标识
ID of the client |
int |
ConnectTimeout
连接到服务器的超时时间,默认是5秒,单位是毫秒
The timeout period for connecting to the server, the default is 5 seconds, the unit is milliseconds |
MqttCredential |
Credentials
登录服务器的凭证
The credentials for logging in to the server, including the username and password, can be null |
String |
IpAddress
Mqtt服务器的ip地址
IP address of Mqtt server |
int |
KeepAlivePeriod
设置的参数,最小单位为1s,当超过设置的时间间隔没有发送数据的时候,必须发送PINGREQ报文,否则服务器认定为掉线。
|
int |
KeepAliveSendInterval
获取或是设置心跳时间的发送间隔。
|
int |
Port
端口号。
|
boolean |
UseRSAProvider
获取或设置当前的连接是否加密处理,防止第三方对注册报文进行抓包处理,从而分析出用户名和密码,只适用于基于HslCommunication创建的MQTT Server。
|
| 构造器和说明 |
|---|
MqttConnectionOptions()
实例化一个默认的对象
Instantiate a default object |
public String IpAddress
public int Port
public String ClientId
public int ConnectTimeout
public MqttCredential Credentials
public int KeepAlivePeriod
public int KeepAliveSendInterval
public boolean CleanSession
public boolean UseRSAProvider
Copyright © 2022. All rights reserved.