def master(options):
 if (not options.silence):
  print ('Master started on PID %s' % os.getpid())
 if options.port:
  webdir = File('.')
  web = Site(webdir)
  web.log = (lambda _: None)
  reactor.listenTCP(options.port, web)
 factory = Factory()
 port = reactor.listenTCP(options.wsport, factory, backlog=options.backlog)
 port.stopReading()
 for i in range(options.workers):
  args = [executable, '-u', __file__, '--fd', str(port.fileno()), '--cpuid', str(i)]
  args.extend(sys.argv[1:])
  reactor.spawnProcess(None, executable, args, childFDs={0: 0, 1: 1, 2: 2, port.fileno(): port.fileno()}, env=os.environ)
 reactor.run()

def master ( options ) : if ( not options . silence ) : print ( 'Master started on PID %s' % os . getpid ( ) ) if options . port : webdir = File ( '.' ) web = Site ( webdir ) web . log = ( lambda _ : None ) reactor . listenTCP ( options . port , web ) factory = Factory ( ) port = reactor . listenTCP ( options . wsport , factory , backlog = options . backlog ) port . stopReading ( ) for i in range ( options . workers ) : args = [ executable , '-u' , __file__ , '--fd' , str ( port . fileno ( ) ) , '--cpuid' , str ( i ) ] args . extend ( sys . argv [ 1 : ] ) reactor . spawnProcess ( None , executable , args , childFDs = { 0 : 0 , 1 : 1 , 2 : 2 , port . fileno ( ) : port . fileno ( ) } , env = os . environ ) reactor . run ( )
start of the master process .