SocketTaskExtensions.ReceiveFromAsync(Socket, ArraySegment<Byte>, SocketFlags, EndPoint) Method

Definition

Получает данные из указанного сетевого устройства.Receives data from a specified network device.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<System::Net::Sockets::SocketReceiveFromResult> ^ ReceiveFromAsync(System::Net::Sockets::Socket ^ socket, ArraySegment<System::Byte> buffer, System::Net::Sockets::SocketFlags socketFlags, System::Net::EndPoint ^ remoteEndPoint);
public static System.Threading.Tasks.Task<System.Net.Sockets.SocketReceiveFromResult> ReceiveFromAsync (this System.Net.Sockets.Socket socket, ArraySegment<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint);
static member ReceiveFromAsync : System.Net.Sockets.Socket * ArraySegment<byte> * System.Net.Sockets.SocketFlags * System.Net.EndPoint -> System.Threading.Tasks.Task<System.Net.Sockets.SocketReceiveFromResult>
<Extension()>
Public Function ReceiveFromAsync (socket As Socket, buffer As ArraySegment(Of Byte), socketFlags As SocketFlags, remoteEndPoint As EndPoint) As Task(Of SocketReceiveFromResult)

Parameters

socket
Socket

Сокет для выполнения операции ReceiveFrom.The socket to perform the ReceiveFrom operation on.

buffer
ArraySegment<Byte>

Массив байтового типа, который является местом хранения полученных данных.An array of type Byte that is the storage location for the received data.

socketFlags
SocketFlags

Побитовое сочетание значений SocketFlags.A bitwise combination of the SocketFlags values.

remoteEndPoint
EndPoint

Конечная точка, представляющая источник данных.An EndPoint that represents the source of the data.

Returns

Task<SocketReceiveFromResult>

Асинхронная задача, выполняющая со структурой SocketReceiveFromResult.An asynchronous Task that completes with a SocketReceiveFromResult struct.

Applies to