Retry connections to SAM bridge

Remove unnecessary debug logging
This commit is contained in:
TheKysek 2017-08-23 18:29:07 +02:00
parent b38d5f8054
commit 05d3b4244d
No known key found for this signature in database
GPG Key ID: 50D9AF00D0B1C497
2 changed files with 9 additions and 3 deletions

View File

@ -18,7 +18,13 @@ class I2PController(threading.Thread):
self.port = port
self.nick = b'MiNode_' + base64.b16encode(os.urandom(4)).lower()
self.s = socket.create_connection((self.host, self.port))
while True:
try:
self.s = socket.create_connection((self.host, self.port))
break
except ConnectionRefusedError:
logging.error("Error while connecting to I2P SAM bridge. Retrying.")
time.sleep(10)
self.version_reply = []

View File

@ -33,11 +33,11 @@ class I2PDialer(threading.Thread):
def _receive_line(self):
line = receive_line(self.s)
logging.debug('I2PDialer <- ' + str(line))
# logging.debug('I2PDialer <- ' + str(line))
return line
def _send(self, command):
logging.debug('I2PDialer -> ' + str(command))
# logging.debug('I2PDialer -> ' + str(command))
self.s.sendall(command)
def _connect(self):