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

Definición

Recibe datos de un dispositivo de red especificado.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>

Parámetros

socket
Socket Socket Socket

Socket en el que se realizará la operación ReceiveFrom.The socket to perform the ReceiveFrom operation on.

buffer
ArraySegment<Byte>

Matriz de tipo Byte que es la ubicación de almacenamiento para los datos recibidos.An array of type Byte that is the storage location for the received data.

socketFlags
SocketFlags SocketFlags SocketFlags

Combinación bit a bit de los valores de SocketFlags.A bitwise combination of the SocketFlags values.

remoteEndPoint
EndPoint EndPoint EndPoint

Punto de conexión que representa el origen de los datos.An EndPoint that represents the source of the data.

Devoluciones

Tarea asincrónica que se completa con una estructura SocketReceiveFromResult.An asynchronous Task that completes with a SocketReceiveFromResult struct.

Se aplica a