Share via


Socket.ReceiveFrom Method

Receives data from an unbound socket, places the data in a buffer array, and gets the data's endpoint.

Overload List

Name Description
Socket.ReceiveFrom (Byte[], EndPoint) Receives all of the data currently available from an unbound socket, places the data in a buffer array, and gets the data's endpoint.
Socket.ReceiveFrom (Byte[], Int32, Int32, SocketFlags, EndPoint) Receives data from an unbound socket, according to specified flags, and places the data in a buffer array, beginning at a specified location in the buffer. This method also gets the data's endpoint.
Socket.ReceiveFrom (Byte[], Int32, SocketFlags, EndPoint) Receives data from an unbound socket, according to specified flags, and places the data in a buffer array. This method also gets the data's endpoint.
Socket.ReceiveFrom (Byte[], SocketFlags, EndPoint) Receives all of the data currently available from an unbound socket, according to specified flags, and places the data in a buffer array. This method also gets the data's endpoint.

Remarks

Although the ReceiveFrom method is intended for connectionless protocols, you can use a connection-oriented protocol as well. If you choose to do the latter, you must first either establish a remote host connection by calling the Connect method or accept an incoming remote host connection by calling the Accept method. If you do not establish or accept a connection before calling the ReceiveFrom method, you will get a SocketException exception. You can also establish a default remote host for a connectionless protocol before calling the ReceiveFrom method. In either of these cases, the ReceiveFrom method will ignore the remoteEP parameter and receive data only from the connected or default remote host.

Version Information

Available in .NET Micro Framework version 2.0, 2.5

See Also

Reference

Socket Class
Socket Members
System.Net.Sockets Namespace