Implement receiveLoop for UDP datagrams.