点击或拖拽改变大小

MqttConnectionOptions 属性

MqttConnectionOptions 类型公开以下成员。

属性
  名称说明
公共属性CertificateFile
获取或设置是否使用CA证书的方式来通信,当为空的时候,默认不使用证书,不为空则使用证书,需要传入证书的完整路径信息
Obtain or set whether to use the certificate authority to communicate, when empty, the default is not to use the certificate, not empty to use the certificate, you need to pass in the full path information of the certificate
公共属性CleanSession
是否清理会话,如果清理会话(CleanSession)标志被设置为1,客户端和服务端必须丢弃之前的任何会话并开始一个新的会话。 会话仅持续和网络连接同样长的时间。与这个会话关联的状态数据不能被任何之后的会话重用 [MQTT-3.1.2-6]。默认为清理会话。
Whether to clean the session. If the CleanSession flag is set to 1, the client and server must discard any previous session and start a new session. The session only lasts as long as the network connection. The state data associated with this session cannot be reused by any subsequent sessions [MQTT-3.1.2-6]. The default is to clean up the session.
公共属性ClientId
客户端的id的标识
ID of the client
公共属性ConnectTimeout
连接到服务器的超时时间,默认是5秒,单位是毫秒
The timeout period for connecting to the server, the default is 5 seconds, the unit is milliseconds
公共属性Credentials
登录服务器的凭证,包含用户名和密码,可以为空
The credentials for logging in to the server, including the username and password, can be null
公共属性HostName
获取当前设置的服务器的网址信息,或是IP地址信息
公共属性IpAddress
Mqtt服务器的ip地址
IP address of Mqtt server
公共属性KeepAlivePeriod
设置的参数,最小单位为1s,当超过设置的时间间隔没有发送数据的时候,必须发送PINGREQ报文,否则服务器认定为掉线。
The minimum unit of the set parameter is 1s. When no data is sent beyond the set time interval, the PINGREQ message must be sent, otherwise the server considers it to be offline.
公共属性KeepAliveSendInterval
获取或是设置心跳时间的发送间隔。默认30秒钟
Get or set the heartbeat time interval. 30 seconds by default
公共属性Port
端口号。默认1883
The port number. Default 1883
公共属性SSLSecure
在使用证书的情况下,获取或设置是否对服务器的证书进行检查并校验的操作,如果设置为True,也就是检查,安全性更高,反之不检查服务器的证书是否合法
In the case of using a certificate, obtain or set whether to check and verify the server's certificate, if set to True, that is, check, the security is higher, and vice versa, the server's certificate is not checked
公共属性UseRSAProvider
获取或设置当前的连接是否加密处理,防止第三方对注册报文进行抓包处理,从而分析出用户名和密码,只适用于基于HslCommunication创建的MQTT Server。
Get or set whether the current connection is encrypted or not, to prevent the third party from capturing the registration message, so as to analyze the user name and password. It is only applicable to the MQTT Server created based on HslCommunication.
公共属性UseSSL
获取或设置是否使用 SSL/TLS 加密的方式来验证
公共属性WillMessage
遗嘱消息,为空或是主题为空则表示不使用遗嘱,该遗嘱对于 MqttSyncClient 无效
Top
参见