点击或拖拽改变大小

NetworkBaseSendMqttFileAsync 方法 (Socket, String, String, String, ActionInt64, Int64, AesCryptography)

使用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

命名空间:  HslCommunication.Core.Net
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:10.6.1.0 (10.6.1.0)
语法
protected Task<OperateResult> SendMqttFileAsync(
	Socket socket,
	string filename,
	string servername,
	string filetag,
	Action<long, long> reportProgress = null,
	AesCryptography aesCryptography = null
)

参数

socket
类型:System.Net.SocketsSocket
网络套接字
filename
类型:SystemString
文件名称
servername
类型:SystemString
对方接收后保存的文件名
filetag
类型:SystemString
文件的描述信息
reportProgress (Optional)
类型:SystemActionInt64, Int64
进度报告,第一个参数是已完成的字节数量,第二个参数是总字节数量。
aesCryptography (Optional)
类型:HslCommunication.Core.SecurityAesCryptography
AES数据加密对象,如果为空,则不进行加密

返回值

类型:TaskOperateResult
是否操作成功
参见