def run_inject(args):
'''
start the injector, and start it listening
'''
# pylint: disable=E1101
injector = PrivCountDataInjector(args.log, args.simulate, float(args.prune_before), float(args.prune_after), args.control_password, args.control_cookie_file)
# The injector listens on all of IPv4, IPv6, and a control socket, and
# injects events into the first client to connect
# Since these are synthetic events, it is safe to use /tmp for the socket
# path
# XXX multiple connections to our server will kill old connections
listener_config = {}
if args.port is not None:
listener_config['port'] = args.port
if args.ip is not None:
listener_config['ip'] = args.ip
if args.unix is not None:
listener_config['unix']= args.unix
listeners = listen(injector, listener_config, ip_version_default = [4, 6])
injector.set_listeners(listeners)
reactor.run()
评论列表
文章目录