点击或拖拽改变大小

MqttSession 类

Mqtt的会话信息,包含了一些基本的信息内容,客户端的IP地址及端口,Client ID,用户名,活动时间,是否允许发布数据等等
Mqtt's session information includes some basic information content, the client's IP address and port, Client ID, user name, activity time, whether it is allowed to publish data, etc.
继承层次
SystemObject
  HslCommunication.MQTTMqttSession

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

MqttSession 类型公开以下成员。

构造函数
  名称说明
公共方法MqttSession
实例化一个对象,指定ip地址及端口,以及协议内容
Instantiate an object, specify ip address and port, and protocol content
Top
属性
  名称说明
公共属性ActiveTime
当前客户端的激活时间
The activation time of the current client
公共属性ActiveTimeSpan
两次活动的最小时间间隔
Minimum time interval between two activities
公共属性ClientId
当前接收的客户端ID信息
Client ID information currently received
公共属性DeveloperPermissions
获取或设置当前的会话是否拥有开发者权限,在开发者权限下,可以遍历接口信息,默认所有的会话都支持开发者权限,如果需要屏蔽,则需要在会话登录时,将本属性值设置为 False
Get or set whether the current session has developer permission. Under developer permission, you can traverse the interface information. By default, all sessions support developer permission. If you need to block, you need to set this attribute value to false
公共属性EndPoint
远程的ip地址端口信息
Remote ip address port information
公共属性ForbidPublishTopic
获取或设置当前的MQTT客户端是否允许发布消息,默认为False,如果设置为True,就是禁止发布消息,服务器不会触发收到消息的事件。
Gets or sets whether the current MQTT client is allowed to publish messages, the default is False, if set to True, it is forbidden to publish messages, The server does not trigger the event of receiving a message.
公共属性IsAesCryptography
获取设置客户端的加密信息
公共属性OnlineTime
获取当前的客户端的上线时间
Get the online time of the current client
公共属性Protocol
当前的协议信息,一般为 "MQTT",如果是同步客户端那么是 "HUSL",如果是文件客户端就是 "FILE"
The current protocol information, generally "MQTT", if it is a synchronous client then it is "HUSL", if it is a file client it is "FILE"
公共属性Tag
当前的会话信息关联的自定义信息
Custom information associated with the current session information
公共属性UserName
当前的用户名
Current username
公共属性WillMessage
遗嘱的消息内容
The message content of the will
公共属性WillTopic
遗嘱主题
will topic
Top
方法
  名称说明
公共方法AddSubscribe(String)
当前的会话信息新增一个订阅的主题信息
The current session information adds a subscribed topic information
公共方法AddSubscribe(String)
当前的会话信息新增多个订阅的主题信息
The current session information adds multiple subscribed topic information
公共方法Equals (继承自 Object。)
受保护的方法Finalize (继承自 Object。)
公共方法GetHashCode (继承自 Object。)
公共方法GetSessionInfo
获取当前会话的基本信息
Obtain basic information about the current session
公共方法GetSessionOnlineInfo
获取当前的会话信息,包含在线时间的信息
Get current session information, including online time information
公共方法GetTopics
获取当前客户端订阅的所有的Topic信息
Get all Topic information subscribed by the current client
公共方法GetType (继承自 Object。)
公共方法IsClientSubscribe
检查当前的会话对象里是否订阅了指定的主题内容
Check whether the specified topic content is subscribed in the current session object
受保护的方法MemberwiseClone (继承自 Object。)
公共方法RemoveSubscribe(String)
移除会话信息的一个订阅的主题
公共方法RemoveSubscribe(String)
移除会话信息的一个订阅的主题
Remove a subscribed topic from session information
公共方法ToString (重写 ObjectToString.)
Top
扩展方法
  名称说明
公共扩展器方法ToJsonString
获取当前对象的JSON格式表示的字符串。
Gets the string represented by the JSON format of the current object.
(由 HslExtension 定义。)
Top
参见