点击或拖拽改变大小

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 中) 版本:10.2.2.0 (10.2.2.0)
语法
public class MqttConnectionOptions

MqttConnectionOptions 类型公开以下成员。

构造函数
  名称说明
公共方法MqttConnectionOptions
实例化一个默认的对象
Instantiate a default object
Top
属性
  名称说明
公共属性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
公共属性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
公共属性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.
Top
方法
  名称说明
公共方法Equals
Determines whether the specified object is equal to the current object.
(继承自 Object。)
受保护的方法Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
公共方法GetHashCode
Serves as the default hash function.
(继承自 Object。)
公共方法GetType
Gets the Type of the current instance.
(继承自 Object。)
受保护的方法MemberwiseClone
Creates a shallow copy of the current Object.
(继承自 Object。)
公共方法ToString
Returns a string that represents the current object.
(继承自 Object。)
Top
扩展方法
  名称说明
公共扩展器方法ToJsonString
获取当前对象的JSON格式表示的字符串。
Gets the string represented by the JSON format of the current object.
(由 HslExtension 定义。)
Top
参见