Socket.EndReceiveMessageFrom(IAsyncResult, SocketFlags, EndPoint, IPPacketInformation) Método

Definición

Finaliza una lectura asincrónica pendiente desde un extremo específico.Ends a pending asynchronous read from a specific endpoint. Este método también desvela más información sobre el paquete 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

IAsyncResult que almacena información de estado así como cualquier dato definido por el usuario para esta operación asincrónica.An IAsyncResult that stores state information and any user defined data for this asynchronous operation.

socketFlags
SocketFlags

Combinación bit a bit de los valores de SocketFlags para el paquete recibido.A bitwise combination of the SocketFlags values for the received packet.

endPoint
EndPoint

EndPoint de origen.The source EndPoint.

ipPacketInformation
IPPacketInformation

IPAddress e interfaz del paquete recibido.The IPAddress and interface of the received packet.

Devoluciones

Si se realiza correctamente, el número de bytes recibidos.If successful, the number of bytes received. Si no se realiza correctamente, devuelve 0.If unsuccessful, returns 0.

Excepciones

asyncResult es null.asyncResult is null

O bien-or- endPoint es null.endPoint is null.

Error al intentar acceder al socket.An error occurred when attempting to access the socket.

Se cerró el Socket.The Socket has been closed.

Comentarios

Si la operación no se ha completado, este método se bloquea hasta que lo hace.If the operation has not completed, this method blocks until it does.

Para realizar esta operación sincrónicamente, utilice el método ReceiveMessageFrom.To perform this operation synchronously, use the ReceiveMessageFrom method.

Examine ipPacketInformation si necesita saber si el datagrama se envió con una dirección de unidifusión, multidifusión o difusión.Examine ipPacketInformation if you need to know if the datagram was sent using a unicast, multicast, or broadcast address.

Se aplica a