点击或拖拽改变大小

MqttHelper 类

Mqtt协议的辅助类,提供了一些协议相关的基础方法,方便客户端和服务器端一起调用。
The auxiliary class of the Mqtt protocol provides some protocol-related basic methods for the client and server to call together.
继承层次
SystemObject
  HslCommunication.MQTTMqttHelper

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

MqttHelper 类型公开以下成员。

构造函数
  名称说明
公共方法MqttHelper
初始化 MqttHelper 类的一个新实例
Top
方法
  名称说明
公共方法静态成员BuildConnectMqttCommand
创建MQTT连接服务器的报文信息
Create MQTT connection server message information
公共方法静态成员BuildIntBytes
从MQTT的缓存信息里,提取长度信息
Extract length information from MQTT cache information
公共方法静态成员BuildMqttCommand(Byte, Byte, Byte, AesCryptography)
将一个数据打包成一个mqtt协议的内容
Pack a piece of data into a mqtt protocol
公共方法静态成员BuildMqttCommand(Byte, Byte, Byte, Byte, AesCryptography)
将一个数据打包成一个mqtt协议的内容
Pack a piece of data into a mqtt protocol
公共方法静态成员BuildPublishMqttCommand(MqttPublishMessage, AesCryptography)
创建Mqtt发送消息的命令
Create Mqtt command to send messages
公共方法静态成员BuildPublishMqttCommand(String, Byte, Boolean, AesCryptography)
创建Mqtt发送消息的命令
Create Mqtt command to send messages
公共方法静态成员BuildSegCommandByString(Byte)
将字符串打包成utf8编码,并且带有2个字节的表示长度的信息
Pack the string into utf8 encoding, and with 2 bytes of length information
公共方法静态成员BuildSegCommandByString(String)
将字符串打包成utf8编码,并且带有2个字节的表示长度的信息
Pack the string into utf8 encoding, and with 2 bytes of length information
公共方法静态成员BuildSubscribeMqttCommand
创建Mqtt订阅消息的命令
Command to create Mqtt subscription message
公共方法静态成员BuildUnSubscribeMqttCommand
创建Mqtt取消订阅消息的命令
Create Mqtt unsubscribe message command
公共方法静态成员CalculateLengthToMqttLength
根据数据的总长度,计算出剩余的数据长度信息
According to the total length of the data, calculate the remaining data length information
公共方法静态成员CheckConnectBack
根据服务器返回的信息判断当前的连接是否是可用的
According to the information returned by the server to determine whether the current connection is available
公共方法静态成员CheckMqttTopicWildcards
判断当前服务器的实际的 topic 的主题,是否满足通配符格式的订阅主题 subTopic
公共方法Equals
Determines whether the specified object is equal to the current object.
(继承自 Object。)
公共方法静态成员ExtraIntFromBytes
从MQTT的缓存信息里,提取长度信息
Extract length information from MQTT cache information
公共方法静态成员ExtraMqttReceiveData
解析从MQTT接受的客户端信息,解析成实际的Topic数据及Payload数据
Parse the client information received from MQTT and parse it into actual Topic data and Payload data
公共方法静态成员ExtraMsgFromBytes
从MQTT的缓存信息里,提取文本信息
Extract text information from MQTT cache information
公共方法静态成员ExtraSubscribeMsgFromBytes
从MQTT的缓存信息里,提取文本信息
Extract text information from MQTT cache information
受保护的方法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。)
公共方法静态成员GetMqttCodeText
获取当前的错误的描述信息
Get a description of the current error
公共方法静态成员GetMqttSyncServicesApiFromMethod
根据当前的方法的委托信息和类对象,生成MqttRpcApiInfo的API对象信息。
公共方法静态成员GetMqttSyncServicesApiFromProperty
根据当前的方法的委托信息和类对象,生成MqttRpcApiInfo的API对象信息。
公共方法静态成员GetSyncServicesApiInformationFromObject(Object)
根据当前的对象定义的方法信息,获取到所有支持ApiTopic的方法列表信息,包含API名称,示例参数数据,描述信息。
According to the method information defined by the current object, the list information of all methods that support ApiTopic is obtained, including the API name, sample parameter data, and description information.
公共方法静态成员GetSyncServicesApiInformationFromObject(String, Object, HslMqttPermissionAttribute)
根据当前的对象定义的方法信息,获取到所有支持ApiTopic的方法列表信息,包含API名称,示例参数数据,描述信息。
According to the method information defined by the current object, the list information of all methods that support ApiTopic is obtained, including the API name, sample parameter data, and description information.
公共方法GetType
Gets the Type of the current instance.
(继承自 Object。)
公共方法静态成员HandleObjectMethod(MqttSession, MqttClientApplicationMessage, MqttRpcApiInfo)
使用指定的对象来返回网络的API接口,前提是传入的数据为json参数,返回的数据为json数据,详细参照说明
Use the specified object to return the API interface of the network, provided that the incoming data is json parameters and the returned data is json data, please refer to the description for details
公共方法静态成员HandleObjectMethod(MqttSession, MqttClientApplicationMessage, Object)
使用指定的对象来返回网络的API接口,前提是传入的数据为json参数,返回的数据为json数据,详细参照说明
Use the specified object to return the API interface of the network, provided that the incoming data is json parameters and the returned data is json data, please refer to the description for details
受保护的方法MemberwiseClone
Creates a shallow copy of the current Object.
(继承自 Object。)
公共方法静态成员ReceiveMqttFile
使用MQTT协议从网络接收字节数组,然后写入文件或流中,支持进度报告
Use MQTT protocol to receive byte array from the network, and then write it to file or stream, support progress report
公共方法静态成员ReceiveMqttFileAsync
使用MQTT协议从网络接收字节数组,然后写入文件或流中,支持进度报告
Use MQTT protocol to receive byte array from the network, and then write it to file or stream, support progress report
公共方法静态成员ReceiveMqttMessage(CommunicationPipe, Int32, ActionInt64, Int64)
接收一条完整的MQTT协议的报文信息,包含控制码和负载数据
Receive a message of a completed MQTT protocol, including control code and payload data
公共方法静态成员ReceiveMqttMessageT(FuncT, Int32, Int32, ActionInt64, Int64, OperateResultByte, T, Int32, ActionInt64, Int64)
接收一条完整的MQTT协议的报文信息,包含控制码和负载数据
Receive a message of a completed MQTT protocol, including control code and payload data
公共方法静态成员ReceiveMqttMessageAsync(CommunicationPipe, Int32, ActionInt64, Int64)
接收一条完整的MQTT协议的报文信息,包含控制码和负载数据
Receive a message of a completed MQTT protocol, including control code and payload data
公共方法静态成员ReceiveMqttMessageAsyncT(FuncT, Int32, Int32, ActionInt64, Int64, TaskOperateResultByte, T, Int32, ActionInt64, Int64)
接收一条完整的MQTT协议的报文信息,包含控制码和负载数据
Receive a message of a completed MQTT protocol, including control code and payload data
公共方法静态成员ReceiveMqttRemainingLength(CommunicationPipe)
基于MQTT协议,从网络套接字中接收剩余的数据长度
Receives the remaining data length from the network socket based on the MQTT protocol
公共方法静态成员ReceiveMqttRemainingLengthT(FuncT, Int32, Int32, ActionInt64, Int64, OperateResultByte, T)
基于MQTT协议,从网络套接字中接收剩余的数据长度
Receives the remaining data length from the network socket based on the MQTT protocol
公共方法静态成员ReceiveMqttRemainingLengthAsync(CommunicationPipe)
基于MQTT协议,从网络套接字中接收剩余的数据长度
Receives the remaining data length from the network socket based on the MQTT protocol
公共方法静态成员ReceiveMqttRemainingLengthAsyncT(FuncT, Int32, Int32, ActionInt64, Int64, TaskOperateResultByte, T)
基于MQTT协议,从网络套接字中接收剩余的数据长度
Receives the remaining data length from the network socket based on the MQTT protocol
公共方法静态成员ReceiveMqttStream
使用MQTT协议从socket接收指定长度的字节数组,然后全部写入到流中,可以指定进度报告
Use the MQTT protocol to receive a byte array of specified length from the socket, and then write all of them to the stream, and you can specify a progress report
公共方法静态成员ReceiveMqttStreamAsync
使用MQTT协议从socket接收指定长度的字节数组,然后全部写入到流中,可以指定进度报告
Use the MQTT protocol to receive a byte array of specified length from the socket, and then write all of them to the stream, and you can specify a progress report
公共方法静态成员SendMqttFile(CommunicationPipe, Stream, String, String, ActionInt64, Int64, AesCryptography, HslCancelToken)
使用MQTT协议将一个数据流发送到网络上去,需要保存的文件名,可选指定文件描述信息,进度报告
Use the MQTT protocol to send a data stream to the network, the file name that needs to be saved, optional file description information, progress report
公共方法静态成员SendMqttFile(CommunicationPipe, String, String, String, ActionInt64, Int64, AesCryptography, HslCancelToken)
使用MQTT协议将一个文件发送到网络上去,需要指定文件名,保存的文件名,可选指定文件描述信息,进度报告
To send a file to the network using the MQTT protocol, you need to specify the file name, the saved file name, optionally specify the file description information, and the progress report
公共方法静态成员SendMqttFileAsync(CommunicationPipe, Stream, String, String, ActionInt64, Int64, AesCryptography, HslCancelToken)
使用MQTT协议将一个数据流发送到网络上去,需要保存的文件名,可选指定文件描述信息,进度报告
Use the MQTT protocol to send a data stream to the network, the file name that needs to be saved, optional file description information, progress report
公共方法静态成员SendMqttFileAsync(CommunicationPipe, String, String, String, ActionInt64, Int64, AesCryptography, HslCancelToken)
使用MQTT协议将一个文件发送到网络上去,需要指定文件名,保存的文件名,可选指定文件描述信息,进度报告
To send a file to the network using the MQTT protocol, you need to specify the file name, the saved file name, optionally specify the file description information, and the progress report
公共方法静态成员SendMqttStream
使用MQTT协议将流中的数据读取到字节数组,然后都写入到socket里面,可以指定进度报告,主要用于将文件发送到网络。
Use the MQTT protocol to read the data in the stream into a byte array, and then write them all into the socket. You can specify a progress report, which is mainly used to send files to the network.
公共方法静态成员SendMqttStreamAsync
使用MQTT协议将流中的数据读取到字节数组,然后都写入到socket里面,可以指定进度报告,主要用于将文件发送到网络。
Use the MQTT protocol to read the data in the stream into a byte array, and then write them all into the socket. You can specify a progress report, which is mainly used to send files to the network.
公共方法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
参见