SocketTaskExtensions.ReceiveFromAsync Método

Definición

Recibe datos de un dispositivo de red especificado.

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)

Parámetros

socket
Socket

Socket en el que se va a realizar la operación ReceiveFrom.

buffer
ArraySegment<Byte>

Matriz de tipo Byte que es la ubicación de almacenamiento de los datos recibidos.

socketFlags
SocketFlags

Combinación bit a bit de los SocketFlags valores.

remoteEndPoint
EndPoint

EndPoint que representa el origen de los datos.

Devoluciones

Tarea asincrónica que se completa con una estructura SocketReceiveFromResult.

Excepciones

buffer es null.

O bien

remoteEndPoint es null.

Error al intentar acceder al socket.

Un autor de llamada de la pila de llamadas no tiene los permisos necesarios.

Se aplica a