mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-12-22 19:39:22 +00:00
Sync test: rewrote stratum connection code
This commit is contained in:
parent
e7545db663
commit
f44ffd1959
1 changed files with 10 additions and 6 deletions
|
@ -5,15 +5,19 @@ import json
|
||||||
|
|
||||||
f = open('stratum_dummy' + sys.argv[1] + '.log', 'wb')
|
f = open('stratum_dummy' + sys.argv[1] + '.log', 'wb')
|
||||||
|
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
||||||
sock.settimeout(1)
|
|
||||||
sock.setblocking(True)
|
|
||||||
|
|
||||||
f.write(b'Connecting')
|
f.write(b'Connecting')
|
||||||
f.flush()
|
f.flush()
|
||||||
time.sleep(5)
|
|
||||||
|
|
||||||
while sock.connect_ex(('127.0.0.1', 3333)) != 0:
|
while True:
|
||||||
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
sock.settimeout(1)
|
||||||
|
sock.setblocking(True)
|
||||||
|
|
||||||
|
if sock.connect_ex(('127.0.0.1', 3333)) == 0:
|
||||||
|
break;
|
||||||
|
|
||||||
|
sock.close()
|
||||||
|
|
||||||
f.write(b'.')
|
f.write(b'.')
|
||||||
f.flush()
|
f.flush()
|
||||||
print('.')
|
print('.')
|
||||||
|
|
Loading…
Reference in a new issue