summaryrefslogtreecommitdiff
path: root/testing/rect.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/rect.py')
-rw-r--r--testing/rect.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/testing/rect.py b/testing/rect.py
index 816e6e8c..59d6c158 100644
--- a/testing/rect.py
+++ b/testing/rect.py
@@ -14,7 +14,7 @@ sock.bind((UDP_IP, UDP_PORT))
14client_id = str(''.join(random.choice("abcdefghijklmnopqrstuvwxyz") for x in range(32))) 14client_id = str(''.join(random.choice("abcdefghijklmnopqrstuvwxyz") for x in range(32)))
15 15
16print client_id 16print client_id
17 17a = 1;
18#send ping request to our DHT on localhost. 18#send ping request to our DHT on localhost.
19sock.sendto("0012345678".decode("hex") + client_id, ('127.0.0.1', 33445)) 19sock.sendto("0012345678".decode("hex") + client_id, ('127.0.0.1', 33445))
20 20
@@ -34,4 +34,12 @@ while True:
34 #send send nodes packet with a couple 127.0.0.1 ips and ports. 34 #send send nodes packet with a couple 127.0.0.1 ips and ports.
35 #127.0.0.1:5000, 127.0.0.1:5001, 127.0.0.1:5002 35 #127.0.0.1:5000, 127.0.0.1:5001, 127.0.0.1:5002
36 sock.sendto("03".decode('hex') + data[1:5] + client_id + ("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + "7F00000113880000".decode('hex') + "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + "7F00000113890000".decode('hex') + "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + "7F000001138A0000".decode('hex')), addr) 36 sock.sendto("03".decode('hex') + data[1:5] + client_id + ("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + "7F00000113880000".decode('hex') + "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + "7F00000113890000".decode('hex') + "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + "7F000001138A0000".decode('hex')), addr)
37
38 if data[0] == "10".decode('hex'):
39 print "Sending handshake resp"
40 sock.sendto("10".decode('hex') + data[1:5] + client_id[:4], addr)
41 if data[0] == "11".decode('hex'):
42 print "Sending SYNC resp"
43 a+=1
44 sock.sendto("11".decode('hex') + chr(a) + data[1:9], addr)
37 45