catch network-unreachable error in dht protocol

This commit is contained in:
Jack Robison 2017-07-13 14:50:16 -04:00
parent 7f36bed79d
commit 422dbb549b
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF

View file

@ -367,7 +367,11 @@ class KademliaProtocol(protocol.DatagramProtocol):
# i'm scared this may swallow important errors, but i get a million of these
# on Linux and it doesnt seem to affect anything -grin
log.debug("Can't send data to dht: EWOULDBLOCK")
elif err.errno == errno.ENETUNREACH:
# this should probably try to retransmit when the network connection is back
log.error("Network is unreachable")
else:
log.error("DHT socket error: %s (%i)", err.message, err.errno)
raise err
def _sendResponse(self, contact, rpcID, response):