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

Definição

Recebe o número de bytes de dados no local especificado no buffer de dados usando o SocketFlags especificado e armazena as informações de ponto de extremidade e pacote.Receives the specified number of bytes of data into the specified location of the data buffer, using the specified SocketFlags, and stores the endpoint and packet information.

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

Parâmetros

socket
Socket

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

buffer
ArraySegment<Byte>

Uma matriz que é o local de armazenamento dos dados recebidos.An array that is the storage location for 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 o servidor remoto.An EndPoint, that represents the remote server.

Retornos

Task<SocketReceiveMessageFromResult>

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

Aplica-se a