+ if listen[1] is None:
+ listen[1] = 5900
+ ready = False
+ while not ready and listen[1] < 6000:
+ try:
+ reactor.listenTCP(listen[1], ProxyFactory(connect_host, connect_port, authtoken, machine), interface=listen[0])
+ ready = True
+ except error.CannotListenError:
+ listen[1] += 1
+ else:
+ reactor.listenTCP(listen[1], ProxyFactory(connect_host, connect_port, authtoken, machine))