CommunicationPipeReceiveAsync 方法 (Int32, Int32, ActionInt64, Int64) |
从管道里,接收指定长度的报文数据信息,如果长度指定为-1,表示接收不超过2048字节的动态长度。另外可以指定超时时间,进度报告等
Receives the packet data of a specified length from the pipe. If the length is set to -1,
it indicates that the dynamic length of the packet is not more than 2048 bytes. You can also specify timeouts, progress reports, etc
命名空间:
HslCommunication.Core.Pipe
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public virtual Task<OperateResult<byte[]>> ReceiveAsync(
int length,
int timeOut,
Action<long, long> reportProgress = null
)
Public Overridable Function ReceiveAsync (
length As Integer,
timeOut As Integer,
Optional reportProgress As Action(Of Long, Long) = Nothing
) As Task(Of OperateResult(Of Byte()))
public:
virtual Task<OperateResult<array<unsigned char>^>^>^ ReceiveAsync(
int length,
int timeOut,
Action<long long, long long>^ reportProgress = nullptr
)
abstract ReceiveAsync :
length : int *
timeOut : int *
?reportProgress : Action<int64, int64>
(* Defaults:
let _reportProgress = defaultArg reportProgress null
*)
-> Task<OperateResult<byte[]>>
override ReceiveAsync :
length : int *
timeOut : int *
?reportProgress : Action<int64, int64>
(* Defaults:
let _reportProgress = defaultArg reportProgress null
*)
-> Task<OperateResult<byte[]>>
参数
- length
- 类型:SystemInt32
接收的长度信息 - timeOut
- 类型:SystemInt32
指定的超时时间 - reportProgress (Optional)
- 类型:SystemActionInt64, Int64
进行进度报告的委托
返回值
类型:
TaskOperateResultByte是否接收成功的结果对象
参见