Socket.EndReceiveMessageFrom(IAsyncResult, SocketFlags, EndPoint, IPPacketInformation) Método
Definição
Termina uma leitura assíncrona pendente de um ponto de extremidade específico.Ends a pending asynchronous read from a specific endpoint. Esse método também revela mais informações sobre o pacote que EndReceiveFrom(IAsyncResult, EndPoint).This method also reveals more information about the packet than EndReceiveFrom(IAsyncResult, EndPoint).
public:
int EndReceiveMessageFrom(IAsyncResult ^ asyncResult, System::Net::Sockets::SocketFlags % socketFlags, System::Net::EndPoint ^ % endPoint, [Runtime::InteropServices::Out] System::Net::Sockets::IPPacketInformation % ipPacketInformation);
public int EndReceiveMessageFrom (IAsyncResult asyncResult, ref System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint endPoint, out System.Net.Sockets.IPPacketInformation ipPacketInformation);
member this.EndReceiveMessageFrom : IAsyncResult * SocketFlags * EndPoint * IPPacketInformation -> int
Public Function EndReceiveMessageFrom (asyncResult As IAsyncResult, ByRef socketFlags As SocketFlags, ByRef endPoint As EndPoint, ByRef ipPacketInformation As IPPacketInformation) As Integer
Parâmetros
- asyncResult
- IAsyncResult
Um IAsyncResult que armazena informações de estado e dados definidos pelo usuário para essa operação assíncrona.An IAsyncResult that stores state information and any user defined data for this asynchronous operation.
- socketFlags
- SocketFlags
Uma combinação bit a bit dos valores SocketFlags para o pacote recebido.A bitwise combination of the SocketFlags values for the received packet.
- ipPacketInformation
- IPPacketInformation
O IPAddress e a interface do pacote recebido.The IPAddress and interface of the received packet.
Retornos
Se tiver êxito, o número de bytes recebidos.If successful, the number of bytes received. Caso contrário, retornará 0.If unsuccessful, returns 0.
Exceções
asyncResult é nullasyncResult is null
- ou --or-
endPoint é null.endPoint is null.
asyncResult não foi retornado por uma chamada ao método BeginReceiveMessageFrom(Byte[], Int32, Int32, SocketFlags, EndPoint, AsyncCallback, Object).asyncResult was not returned by a call to the BeginReceiveMessageFrom(Byte[], Int32, Int32, SocketFlags, EndPoint, AsyncCallback, Object) method.
O EndReceiveMessageFrom(IAsyncResult, SocketFlags, EndPoint, IPPacketInformation) foi chamado anteriormente para a leitura assíncrona.EndReceiveMessageFrom(IAsyncResult, SocketFlags, EndPoint, IPPacketInformation) was previously called for the asynchronous read.
Ocorreu um erro ao tentar acessar o soquete.An error occurred when attempting to access the socket.
Comentários
Se a operação não tiver sido concluída, esse método será bloqueado até que ele seja.If the operation has not completed, this method blocks until it does.
Para executar essa operação de forma síncrona, use o ReceiveMessageFrom método.To perform this operation synchronously, use the ReceiveMessageFrom method.
Examine ipPacketInformation se você precisa saber se o datagrama foi enviado usando um endereço unicast, multicast ou de difusão.Examine ipPacketInformation if you need to know if the datagram was sent using a unicast, multicast, or broadcast address.