Browse Source

Stop UDPSocket on socket.error 101 (Network is unreachable)

v0.6
Dmitri Bogomolov 3 years ago
parent
commit
03316496b7
Signed by untrusted user: g1itch GPG Key ID: 720A756F18DEED13
  1. 5
      src/network/udp.py

5
src/network/udp.py

@ -146,6 +146,9 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
retval = self.socket.sendto(
self.write_buf, ('<broadcast>', self.port))
except socket.error as e:
logger.error("socket error on sendato: %s", e)
logger.error("socket error on sendto: %s", e)
if e.errno == 101:
self.announcing = False
self.socket.close()
retval = 0
self.slice_write_buf(retval)

Loading…
Cancel
Save