SocketTaskExtensions.ReceiveFromAsync(Socket, ArraySegment<Byte>, SocketFlags, EndPoint) Método

Definição

Recebe dados de um dispositivo de rede 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

O soquete no qual executar a operação ReceiveFrom.The socket to perform the ReceiveFrom operation on.

buffer
ArraySegment<Byte>

Uma matriz do tipo Byte que é o local de armazenamento dos dados recebidos.An array of type Byte that is the storage location for the received data.

socketFlags
SocketFlags

Uma combinação bit a bit dos valores SocketFlags.A bitwise combination of the SocketFlags values.

remoteEndPoint
EndPoint

Um EndPoint que representa a fonte dos dados.An EndPoint that represents the source of the data.

Retornos

Uma tarefa assíncrona concluída com um struct SocketReceiveFromResult.An asynchronous Task that completes with a SocketReceiveFromResult struct.

Aplica-se a