-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclient02.py
44 lines (35 loc) · 1.07 KB
/
client02.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
import time
from erlport import Port, Protocol
from erlport import String
class ClientProtocol(Protocol):
def handle_fix_request1(self, arg1):
#
# Add your processing here.
#
arg1 = String(arg1)
dbg_write('handling arg1: %s' % arg1)
result = [arg1.upper(), ]
return result
def handle_fix_request2(self, arg1):
#
# Add your processing here.
#
arg1 = String(arg1)
dbg_write('handling arg1: %s' % arg1)
result = [arg1.upper(), arg1.upper(), ]
return result
def handle_fix_request3(self, arg1):
#
# Add your processing here.
#
arg1 = String(arg1)
dbg_write('handling arg1: %s' % arg1)
result = [arg1.upper(), arg1.upper(), arg1.upper(), ]
return result
def dbg_write(msg):
outfile = open("debug.log", 'a')
outfile.write('-----\n%s\n%s\n' % (time.ctime(), msg, ))
outfile.close()
if __name__ == "__main__":
proto = ClientProtocol()
proto.run(Port(use_stdio=True, packet=4, compressed=True))