added raise CommunicationFailedError when out of tries
added udp error handling