Chapter 7, Developing applications over TCP/IP using Internet sockets
Receiving on datagram sockets (Internet domain)

Receiving on datagram sockets (Internet domain)

To receive data on an unconnected datagram socket, use recvfrom:

recvfrom (s, buf, buflen, flags, (struct sockaddr *) &from, &fromlen);

fromlen initially contains the size of the from buffer, and is modified on return to indicate the actual size of the address from which the datagram was received.

For an example, see Example 7-13, ``Reading Internet domain datagrams''.