点击或拖拽改变大小

MqttConnectionOptions 类

连接MQTT服务器的一些参数信息,适用MqttClient消息发布订阅客户端以及MqttSyncClient同步请求客户端。
Some parameter information for connecting to the MQTT server is applicable to the MqttClient message publishing and subscription client and the MqttSyncClient synchronization request client.
继承层次
SystemObject
  HslCommunication.MQTTMqttConnectionOptions

命名空间:  HslCommunication.MQTT
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public class MqttConnectionOptions

MqttConnectionOptions 类型公开以下成员。

构造函数
  名称说明
公共方法MqttConnectionOptions
实例化一个默认的对象
Instantiate a default object
Top
属性
  名称说明
公共属性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
方法
  名称说明
公共方法Equals (继承自 Object。)
受保护的方法Finalize (继承自 Object。)
公共方法GetHashCode (继承自 Object。)
公共方法GetType (继承自 Object。)
受保护的方法MemberwiseClone (继承自 Object。)
公共方法ToString (继承自 Object。)
Top
扩展方法
  名称说明
公共扩展器方法ToJsonString
获取当前对象的JSON格式表示的字符串。
Gets the string represented by the JSON format of the current object.
(由 HslExtension 定义。)
Top
参见