-
-
Notifications
You must be signed in to change notification settings - Fork 369
/
test_rf.py
36 lines (28 loc) · 810 Bytes
/
test_rf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import socket
import time
a = time.time()
for i in range(1):
# Connect to the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 5006))
# Send the data
message = 'r3=9u6ugjhl4x'
print ('Sending : "%s"' % message)
len_sent = s.send(message.encode('utf-8'))
# Receive a response
response = s.recv(1024)
print ('Received: "%s"' % response)
# Clean up
s.close()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 5006))
# Send the data
message = 'r3='
print ('Sending : "%s"' % message)
len_sent = s.send(message.encode('utf-8'))
# Receive a response
response = s.recv(1024)
print ('Received: "%s"' % response)
# Clean up
s.close()
print(time.time()-a)