Implement poll_datagram.