|
|
@ -49,12 +49,12 @@ class Server:
|
|
|
|
threads=100)
|
|
|
|
threads=100)
|
|
|
|
self.connected = True
|
|
|
|
self.connected = True
|
|
|
|
except OSError as error:
|
|
|
|
except OSError as error:
|
|
|
|
if error.errno == errno.EADDRNOTAVAIL:
|
|
|
|
if error.errno == 49:
|
|
|
|
logging.exception("BAZARR cannot bind to specified IP, trying with 0.0.0.0")
|
|
|
|
logging.exception("BAZARR cannot bind to specified IP, trying with 0.0.0.0")
|
|
|
|
self.address = '0.0.0.0'
|
|
|
|
self.address = '0.0.0.0'
|
|
|
|
self.connected = False
|
|
|
|
self.connected = False
|
|
|
|
super(Server, self).__init__()
|
|
|
|
super(Server, self).__init__()
|
|
|
|
elif error.errno == errno.EADDRINUSE:
|
|
|
|
elif error.errno == 48:
|
|
|
|
if self.port != '6767':
|
|
|
|
if self.port != '6767':
|
|
|
|
logging.exception("BAZARR cannot bind to specified TCP port, trying with default (6767)")
|
|
|
|
logging.exception("BAZARR cannot bind to specified TCP port, trying with default (6767)")
|
|
|
|
self.port = '6767'
|
|
|
|
self.port = '6767'
|
|
|
@ -64,6 +64,11 @@ class Server:
|
|
|
|
logging.exception("BAZARR cannot bind to default TCP port (6767) because it's already in use, "
|
|
|
|
logging.exception("BAZARR cannot bind to default TCP port (6767) because it's already in use, "
|
|
|
|
"exiting...")
|
|
|
|
"exiting...")
|
|
|
|
self.shutdown(EXIT_PORT_ALREADY_IN_USE_ERROR)
|
|
|
|
self.shutdown(EXIT_PORT_ALREADY_IN_USE_ERROR)
|
|
|
|
|
|
|
|
elif error.errno == 97:
|
|
|
|
|
|
|
|
logging.exception("BAZARR cannot bind to IPv6 (*), trying with 0.0.0.0")
|
|
|
|
|
|
|
|
self.address = '0.0.0.0'
|
|
|
|
|
|
|
|
self.connected = False
|
|
|
|
|
|
|
|
super(Server, self).__init__()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
logging.exception("BAZARR cannot start because of unhandled exception.")
|
|
|
|
logging.exception("BAZARR cannot start because of unhandled exception.")
|
|
|
|
self.shutdown()
|
|
|
|
self.shutdown()
|
|
|
|