added exception handling to announce()
This commit is contained in:
parent
611734331f
commit
8bcfbb8070
11
main.py
11
main.py
@ -122,10 +122,13 @@ Announce the node's existance to other nodes
|
|||||||
"""
|
"""
|
||||||
logger.info('Announcing')
|
logger.info('Announcing')
|
||||||
while not self.exitapp:
|
while not self.exitapp:
|
||||||
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
|
try:
|
||||||
sock.sendto(self.index_last_update, ("ff02::1", self.announce_port))
|
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
|
||||||
sock.close()
|
sock.sendto(self.index_last_update, ("ff02::1", self.announce_port))
|
||||||
time.sleep(5)
|
#sock.close()
|
||||||
|
time.sleep(5)
|
||||||
|
except:
|
||||||
|
logger.warning('Failed to announce myself!')
|
||||||
|
|
||||||
def discover(self):
|
def discover(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user