PowerTCP FTP for .NET
ReadTaskAsync Method



The byte array used to store the received data.
The position in the buffer to store the data.
The maximum number of bytes to receive.
Start an awaitable asynchronous read on the socket.
Syntax
Public Function ReadTaskAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Task(Of Data)
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Task(Of Data)
 
value = instance.ReadTaskAsync(buffer, offset, count)
public Task<Data> ReadTaskAsync( 
   byte[] buffer,
   int offset,
   int count
)
public:
Task<Data^>^ ReadTaskAsync( 
   array<byte>^ buffer,
   int offset,
   int count
) 

Parameters

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The maximum number of bytes to receive.

Return Value

A task that represents the asynchronous read operation. The value of the TResult parameter contains the Data object encapsulating the received data (null if the socket is closed).
Remarks
ReadTaskAsync encapsulates ReadAsync and its callback into an easy-to-use awaitable method, leveraging the benefits of IO completion ports without the complexity of callbacks.
See Also

Reference

TcpBase Class
TcpBase Members


PowerTCP FTP for .NET Documentation Version 6.1
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic