-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathfixsim-server.py
More file actions
34 lines (22 loc) · 839 Bytes
/
fixsim-server.py
File metadata and controls
34 lines (22 loc) · 839 Bytes
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
import sys
import argparse
from twisted.internet import reactor
from fixsim.server import create_acceptor
def parse_options(arguments):
parser = argparse.ArgumentParser(description='Run FIX server simulator')
parser.add_argument('-ac', '--acceptor_config', type=str, required=True
, help='Path to FIX config file')
parser.add_argument('-c', '--server_config', type=str, required=True
, help='Path to FIX server config file')
result = parser.parse_args(arguments)
return result
def main(params):
options = parse_options(params)
acceptor = create_acceptor(options.acceptor_config, options.server_config)
acceptor.start()
reactor.run()
if __name__ == "__main__":
args = []
if len(sys.argv) > 1:
args = sys.argv[1:]
main(args)