Assembly: System (in system.dll)
public int ReceiveMessageFrom ( byte buffer, int offset, int size, ref SocketFlags socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation )
public int ReceiveMessageFrom ( byte buffer, int offset, int size, /** @ref */ SocketFlags socketFlags, /** @ref */ EndPoint remoteEP, /** @attribute OutAttribute() */ /** @ref */ IPPacketInformation ipPacketInformation )
An array of type Byte that is the storage location for received data.
The position in the buffer parameter to store the received data.
The number of bytes to receive.
A bitwise combination of the SocketFlags values.
An EndPoint, passed by reference, that represents the remote server.
An IPPacketInformation holding address and interface information.
Return ValueThe number of bytes received.
buffer is a null reference (Nothing in Visual Basic).
remoteEP is a null reference (Nothing in Visual Basic).
offset is less than 0.
offset is greater than the length of buffer.
size is less than 0.
size is greater than the length of the buffer minus the value of the offset parameter.
socketFlags is not a valid combination of values.
The LocalEndPoint property was not set.
The .NET Framework is running on an AMD 64-bit processor.
An error occurred when attempting to access the socket. See the Remarks section for more information.
The Socket has been closed.
The operating system is Windows 2000 or earlier, and this method requires Windows XP.
The ReceiveMessageFrom method reads data into the buffer parameter, returns the number of bytes successfully read, and captures the remote host endpoint from which the data was sent, as well as information about the received packet.
Examine ipPacketInformation if you need to know if the datagram was sent using a unicast, multicast, or broadcast address.
This member outputs trace information when you enable network tracing in your application. For more information, see Network Tracing.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.