def main(self): if self.mode == "UDP": server = UDPRegistryServer(host='::' if self.ipv6 else '0.0.0.0', port=self.port, pruning_timeout=self.pruning_timeout) elif self.mode == "TCP": server = TCPRegistryServer(port=self.port, pruning_timeout=self.pruning_timeout) setup_logger(self.quiet, self.logfile) server.start()
def main(self): if self.mode == "UDP": server = UDPRegistryServer(host=self.host, port=self.port, pruning_timeout=self.timeout) elif self.mode == "TCP": server = TCPRegistryServer(port=self.port, pruning_timeout=self.timeout) setup_logger(self.quiet, self.logfile) print >> sys.stderr, "Starting registry on port %s..." % self.port server.start()
def main(): options, args = parser.parse_args() if args: raise ValueError("does not take positional arguments: %r" % (args, )) if options.port < 1 or options.port > 65535: raise ValueError("invalid TCP/UDP port %r" % (options.port, )) if options.mode.lower() == "udp": server = UDPRegistryServer(port=options.port, pruning_timeout=options.pruning_timeout) elif options.mode.lower() == "tcp": server = TCPRegistryServer(port=options.port, pruning_timeout=options.pruning_timeout) else: raise ValueError("invalid mode %r" % (options.mode, )) setup_logger(options) server.start()
def main(): options, args = parser.parse_args() server = TCPRegistryServer(port=18811, pruning_timeout=61) setup_logger(options) server.start()
def _get_server(self): return TCPRegistryServer(pruning_timeout=PRUNING_TIMEOUT)
def _get_server(self): return TCPRegistryServer(pruning_timeout=PRUNING_TIMEOUT, allow_listing=True)
def main(): options, args = parser.parse_args() server = TCPRegistryServer(port=18811, pruning_timeout=61) setup_logger(options) server.start()
def boot(self, ev): self.logger.debug("Starting server") server = TCPRegistryServer(host="0.0.0.0", port=REGISTRY_PORT, logger=self.logger) thread = threading.Thread(target=server.start) thread.daemon = True thread.start()
help="quiet mode (no logging)") parser.add_option("-t", "--timeout", action="store", dest="pruning_timeout", type="int", default=DEFAULT_PRUNING_TIMEOUT, help="sets a custom pruning timeout") options, args = parser.parse_args() if args: raise ValueError("does not take positional arguments: %r" % (args, )) if options.port < 1 or options.port > 65535: raise ValueError("invalid TCP/UDP port %r" % (options.port, )) if options.mode.lower() == "udp": server = UDPRegistryServer(port=options.port, pruning_timeout=options.pruning_timeout) elif options.mode.lower() == "tcp": server = TCPRegistryServer(port=options.port, pruning_timeout=options.pruning_timeout) else: raise ValueError("invalid mode %r" % (options.mode, )) server.logger.quiet = options.quiet if options.logfile: server.logger.console = open(options.logfile) server.start()