def add_factory(port_map_desc):
match = port_map_pattern.match(port_map_desc)
if not match: die_usage("malformed port map description: %s" % port_map_desc)
listen_port = int(match.group(1))
remote_host = match.group(2)
remote_port = int(match.group(3))
factory = HexdumpServerFactory(listen_port, remote_host, remote_port)
reactor.listenTCP(factory.listen_port, factory)
评论列表
文章目录