MqttHelperReceiveMqttFile 方法 |
使用MQTT协议从网络接收字节数组,然后写入文件或流中,支持进度报告
Use MQTT protocol to receive byte array from the network, and then write it to file or stream, support progress report
命名空间:
HslCommunication.MQTT
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static OperateResult<FileBaseInfo> ReceiveMqttFile(
CommunicationPipe pipe,
Object source,
Action<long, long> reportProgress = null,
AesCryptography aesCryptography = null,
HslCancelToken cancelToken = null
)
Public Shared Function ReceiveMqttFile (
pipe As CommunicationPipe,
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)
public:
static OperateResult<FileBaseInfo^>^ ReceiveMqttFile(
CommunicationPipe^ pipe,
Object^ source,
Action<long long, long long>^ reportProgress = nullptr,
AesCryptography^ aesCryptography = nullptr,
HslCancelToken^ cancelToken = nullptr
)
static member ReceiveMqttFile :
pipe : CommunicationPipe *
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>
参数
- pipe
- 类型:HslCommunication.Core.PipeCommunicationPipe
当前的管道对象信息 - source
- 类型:SystemObject
文件名或是流 - reportProgress (Optional)
- 类型:SystemActionInt64, Int64
进度报告 - aesCryptography (Optional)
- 类型:HslCommunication.Core.SecurityAesCryptography
AES数据加密对象,如果为空,则不进行加密 - cancelToken (Optional)
- 类型:HslCommunication.CoreHslCancelToken
用户取消的令牌信息
返回值
类型:
OperateResultFileBaseInfo是否操作成功,如果成功,携带文件基本信息
参见