Added warnings about changing port settings in api and network.tcp
This commit is contained in:
parent
d2a896697d
commit
bbdbca253b
|
@ -95,6 +95,8 @@ class singleAPI(StoppableThread):
|
||||||
for attempt in range(50):
|
for attempt in range(50):
|
||||||
try:
|
try:
|
||||||
if attempt > 0:
|
if attempt > 0:
|
||||||
|
logger.warning(
|
||||||
|
'Failed to start API listener on port %s', port)
|
||||||
port = random.randint(32767, 65535)
|
port = random.randint(32767, 65535)
|
||||||
se = StoppableXMLRPCServer(
|
se = StoppableXMLRPCServer(
|
||||||
(BMConfigParser().get(
|
(BMConfigParser().get(
|
||||||
|
@ -106,8 +108,9 @@ class singleAPI(StoppableThread):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if attempt > 0:
|
if attempt > 0:
|
||||||
|
logger.warning('Setting apiport to %s', port)
|
||||||
BMConfigParser().set(
|
BMConfigParser().set(
|
||||||
"bitmessagesettings", "apiport", str(port))
|
'bitmessagesettings', 'apiport', str(port))
|
||||||
BMConfigParser().save()
|
BMConfigParser().save()
|
||||||
break
|
break
|
||||||
se.register_introspection_functions()
|
se.register_introspection_functions()
|
||||||
|
|
|
@ -371,6 +371,7 @@ class TCPServer(AdvancedDispatcher):
|
||||||
for attempt in range(50):
|
for attempt in range(50):
|
||||||
try:
|
try:
|
||||||
if attempt > 0:
|
if attempt > 0:
|
||||||
|
logger.warning('Failed to bind on port %s', port)
|
||||||
port = random.randint(32767, 65535)
|
port = random.randint(32767, 65535)
|
||||||
self.bind((host, port))
|
self.bind((host, port))
|
||||||
except socket.error as e:
|
except socket.error as e:
|
||||||
|
@ -378,6 +379,7 @@ class TCPServer(AdvancedDispatcher):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if attempt > 0:
|
if attempt > 0:
|
||||||
|
logger.warning('Setting port to %s', port)
|
||||||
BMConfigParser().set(
|
BMConfigParser().set(
|
||||||
'bitmessagesettings', 'port', str(port))
|
'bitmessagesettings', 'port', str(port))
|
||||||
BMConfigParser().save()
|
BMConfigParser().save()
|
||||||
|
|
Reference in New Issue
Block a user