MqttHelperReceiveMqttMessageAsyncT 方法 (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
命名空间:
HslCommunication.MQTT
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static Task<OperateResult<byte, byte[]>> ReceiveMqttMessageAsync<T>(
Func<T, int, int, Action<long, long>, Task<OperateResult<byte[]>>> receive,
T pipe,
int timeOut,
Action<long, long> reportProgress = null
)
Public Shared Function ReceiveMqttMessageAsync(Of T) (
receive As Func(Of T, Integer, Integer, Action(Of Long, Long), Task(Of OperateResult(Of Byte()))),
pipe As T,
timeOut As Integer,
Optional reportProgress As Action(Of Long, Long) = Nothing
) As Task(Of OperateResult(Of Byte, Byte()))
public:
generic<typename T>
static Task<OperateResult<unsigned char, array<unsigned char>^>^>^ ReceiveMqttMessageAsync(
Func<T, int, int, Action<long long, long long>^, Task<OperateResult<array<unsigned char>^>^>^>^ receive,
T pipe,
int timeOut,
Action<long long, long long>^ reportProgress = nullptr
)
static member ReceiveMqttMessageAsync :
receive : Func<'T, int, int, Action<int64, int64>, Task<OperateResult<byte[]>>> *
pipe : 'T *
timeOut : int *
?reportProgress : Action<int64, int64>
(* Defaults:
let _reportProgress = defaultArg reportProgress null
*)
-> Task<OperateResult<byte, byte[]>>
参数
- receive
- 类型:SystemFuncT, Int32, Int32, ActionInt64, Int64, TaskOperateResultByte
接收数据的方法 - pipe
- 类型:T
实际的管道对象信息 - timeOut
- 类型:SystemInt32
超时时间 - reportProgress (Optional)
- 类型:SystemActionInt64, Int64
进度报告,第一个参数是已完成的字节数量,第二个参数是总字节数量。
类型参数
- T
- 当前的管道类型
返回值
类型:
TaskOperateResultByte,
Byte结果数据内容
参见