Fixed a bug with sleep mode

1st patch was for trying to reconnect. This one is for keeping to retry until it works !
This commit is contained in:
Yanis Boucherk 2021-03-17 22:15:25 +01:00 committed by GitHub
parent 6027b4a6b2
commit dc1457bd78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -34,6 +34,12 @@ while True:
feedback = soc.recv(1024).decode() # Get feedback about the result
print(feedback)
except:
soc.close()
soc = socket.socket()
soc.connect((str(pool_address), int(pool_port))) # Connect to the server
while True:
try:
soc.close()
soc = socket.socket()
soc.connect((str(pool_address), int(pool_port))) # Connect to the server
except:
pass
else:
break