- Receives a datagram from the UDP socket. If the UDP socket is connected, only datagrams coming from the peer are accepted. Otherwise, the returned datagram can come from any host. If there are more than size bytes available in the datagram, the excess bytes are discarded. If there are less then size bytes available in the current datagram, the available bytes are returned.