Пример #1
0
 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()
Пример #2
0
 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()
Пример #3
0
 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()
Пример #4
0
 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()
Пример #5
0
 def __start_register():
     while True:
         server = None
         try:
             debug(
                 'TrackerService.__start_register - Starting the registration server'
             )
             server = UDPRegistryServer(
                 pruning_timeout=DEFAULT_PRUNING_TIMEOUT)
             server.start()
             break
         except Exception as e:
             error(
                 f'TrackerService.__start_register - Error starting server to register, sleeping 5 seconds and trying again. Exception: {e}'
             )
             if server is not None:
                 server.close()
             sleep(5)
Пример #6
0
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()
Пример #7
0
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()
Пример #8
0
def start_registry():
    from rpyc.utils.registry import UDPRegistryServer, REGISTRY_PORT, DEFAULT_PRUNING_TIMEOUT
    registry = UDPRegistryServer(host='0.0.0.0',
                                 port=REGISTRY_PORT,
                                 pruning_timeout=DEFAULT_PRUNING_TIMEOUT)
    registry.start()
Пример #9
0
parser.add_option("-q", "--quiet", action="store_true", dest="quiet", default=False, 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()
Пример #10
0
                  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()