NetworkBaseReceiveMqttFile 方法 |
使用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 中) 版本:12.1.2.0 (12.1.2.0)
语法 protected OperateResult<FileBaseInfo> ReceiveMqttFile(
Socket socket,
Object source,
Action<long, long> reportProgress = null,
AesCryptography aesCryptography = null,
HslCancelToken cancelToken = null
)
Protected Function ReceiveMqttFile (
socket As Socket,
source As Object,
Optional reportProgress As Action(Of Long, Long) = Nothing,
Optional aesCryptography As AesCryptography = Nothing,
Optional cancelToken As HslCancelToken = Nothing
) As OperateResult(Of FileBaseInfo)
protected:
OperateResult<FileBaseInfo^>^ ReceiveMqttFile(
Socket^ socket,
Object^ source,
Action<long long, long long>^ reportProgress = nullptr,
AesCryptography^ aesCryptography = nullptr,
HslCancelToken^ cancelToken = nullptr
)
member ReceiveMqttFile :
socket : Socket *
source : Object *
?reportProgress : Action<int64, int64> *
?aesCryptography : AesCryptography *
?cancelToken : HslCancelToken
(* Defaults:
let _reportProgress = defaultArg reportProgress null
let _aesCryptography = defaultArg aesCryptography null
let _cancelToken = defaultArg cancelToken null
*)
-> OperateResult<FileBaseInfo>
参数
- socket
- 类型:System.Net.SocketsSocket
网络套接字 - source
- 类型:SystemObject
文件名或是流 - reportProgress (Optional)
- 类型:SystemActionInt64, Int64
进度报告 - aesCryptography (Optional)
- 类型:HslCommunication.Core.SecurityAesCryptography
AES数据加密对象,如果为空,则不进行加密 - cancelToken (Optional)
- 类型:HslCommunication.CoreHslCancelToken
用户取消的令牌信息
返回值
类型:
OperateResultFileBaseInfo是否操作成功,如果成功,携带文件基本信息
参见