点击或拖拽改变大小

NetworkBaseReceiveMqttFileAsync 方法

使用MQTT协议从网络接收字节数组,然后写入文件或流中,支持进度报告
Use MQTT protocol to receive byte array from the network, and then write it to file or stream, support progress report

命名空间:  HslCommunication.Core.Net
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
protected Task<OperateResult<FileBaseInfo>> ReceiveMqttFileAsync(
	Socket socket,
	Object source,
	Action<long, long> reportProgress = null,
	AesCryptography aesCryptography = null,
	HslCancelToken cancelToken = null
)

参数

socket
类型:System.Net.SocketsSocket
网络套接字
source
类型:SystemObject
文件名或是流
reportProgress (Optional)
类型:SystemActionInt64, Int64
进度报告
aesCryptography (Optional)
类型:HslCommunication.Core.SecurityAesCryptography
AES数据加密对象,如果为空,则不进行加密
cancelToken (Optional)
类型:HslCommunication.CoreHslCancelToken
用户取消的令牌信息

返回值

类型:TaskOperateResultFileBaseInfo
是否操作成功,如果成功,携带文件基本信息
参见