Retry connections to SAM bridge
Remove unnecessary debug logging
This commit is contained in:
parent
b38d5f8054
commit
05d3b4244d
|
@ -18,7 +18,13 @@ class I2PController(threading.Thread):
|
||||||
self.port = port
|
self.port = port
|
||||||
self.nick = b'MiNode_' + base64.b16encode(os.urandom(4)).lower()
|
self.nick = b'MiNode_' + base64.b16encode(os.urandom(4)).lower()
|
||||||
|
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
self.s = socket.create_connection((self.host, self.port))
|
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 = []
|
self.version_reply = []
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@ class I2PDialer(threading.Thread):
|
||||||
|
|
||||||
def _receive_line(self):
|
def _receive_line(self):
|
||||||
line = receive_line(self.s)
|
line = receive_line(self.s)
|
||||||
logging.debug('I2PDialer <- ' + str(line))
|
# logging.debug('I2PDialer <- ' + str(line))
|
||||||
return line
|
return line
|
||||||
|
|
||||||
def _send(self, command):
|
def _send(self, command):
|
||||||
logging.debug('I2PDialer -> ' + str(command))
|
# logging.debug('I2PDialer -> ' + str(command))
|
||||||
self.s.sendall(command)
|
self.s.sendall(command)
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user