-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestClient.py
59 lines (41 loc) · 856 Bytes
/
testClient.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
__author__ = 'jli'
from RxpSocket import RxpSocket
from RxpServerSocket import RxpServerSocket
import sys
import time
def main():
print "hello client starting"
fxaPort = int(sys.argv[1])
emuIp = sys.argv[2]
emuPort = int(sys.argv[3])
debug = False
if len(sys.argv) == 5:
debug = True
s = RxpSocket(debug)
s.bind(emuIp, emuPort, fxaPort)
s.connect()
# s.send("Hello")
s.send("SEND DATA")
print "reading file"
readFile = open("Alice.txt", "rb")
nextData = readFile.read()
s.send(nextData)
# s.send("NEED DATA")
# s.recv(3000)
# s.send("World")
# print "CLOSING"
# while not s.terminate():
# pass
# s.send("NEED DATA")
# s.recv(3000)
# s.recv(3000)
# s.send("asdf")
#
# s.send("HELLo")
# res = s.recv(3000)
# print res
# s.send("WORLD")
# res = s.recv(3000)
# print res
if __name__ == "__main__":
main()