Start the server
504224
public function bind()
    {

        $err = $errno = 0;

        $this->FLASH_POLICY_FILE = str_replace('to-ports="*', 'to-ports="' . $this->uri->getPort() ?: 80, $this->FLASH_POLICY_FILE);

        $serverSocket = stream_socket_server($this->uri->toString(), $errno, $err, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $this->_context);

        $this->_logger->notice(sprintf("phpws listening on %s", $this->uri->toString()));

        if ($serverSocket == false) {
            $this->_logger->err("Error: $err");
            return;
        }

        $timeOut = & $this->purgeUserTimeOut;
        $sockets = $this->_streams;
        $that = $this;
        $logger = $this->_logger;

        $this->loop->addReadStream($serverSocket, function ($serverSocket) use ($that, $logger, $sockets) {
            try
            {
                $newSocket = stream_socket_accept($serverSocket);
            } catch (\ErrorException $e) {
                $newSocket = false;
            }

            if (false === $newSocket) {
                return;
            }

            stream_set_blocking($newSocket, 0);
            $client = new WebSocketConnection($newSocket, $that->loop, $logger);
            $sockets->attach($client);

            $client->on("handshake", function(Handshake $request) use($that, $client){
                $that->emit("handshake",array($client->getTransport(), $request));
            });

            $client->on("connect", function () use ($that, $client, $logger) {
                $con = $client->getTransport();
                $that->getConnections()->attach($con);
                $that->emit("connect", array("client" => $con));
            });

            $client->on("message", function ($message) use ($that, $client, $logger) {
                $connection = $client->getTransport();
                $that->emit("message", array("client" => $connection, "message" => $message));
            });

            $client->on("close", function () use ($that, $client, $logger, &$sockets) {
                $sockets->detach($client);
                $connection = $client->getTransport();

                if($connection){
                    $that->getConnections()->detach($connection);
                    $that->emit("disconnect", array("client" => $connection));
                }
            });

            $client->on("flashXmlRequest", function () use ($that, $client) {
                $client->getTransport()->sendString($that->FLASH_POLICY_FILE);
                $client->close();
            });
        });

        $this->loop->addPeriodicTimer(5, function () use ($timeOut, $sockets, $that) {

            # Lets send some pings
            foreach($that->getConnections() as $c){
                if($c instanceof WebSocketTransportHybi)
                    $c->sendFrame(WebSocketFrame::create(WebSocketOpcode::PingFrame));
            }

            $currentTime = time();
            if ($timeOut == null)
                return;

            foreach ($sockets as $s) {
                if ($currentTime - $s->getLastChanged() > $timeOut) {
                    $s->close();
                }
            }
        });
    }
451073
public void startServer() {

    server = new Server(httpPort);
    server.setHandler(wrapHandlers());

    if (isWebSocketInClassPath()) {
      setupForWebSocket();
    }
    try {
      server.start();
      log().info("server started");

      Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownRunnable()));
      
      if (useStdInShutdown) {
        // generally for use in IDE via JettyRun, Use CTRL-D in IDE console to shutdown
        BufferedReader systemIn = new BufferedReader(new InputStreamReader(System.in, "UTF-8"));
        while((systemIn.readLine()) != null) {
          // ignore anything except CTRL-D by itself
        }
        System.out.println("Shutdown via CTRL-D");
        System.exit(0);
      }

    } catch (Exception e) {
      e.printStackTrace();
      System.exit(100);
    }
  }
46028
public static void start() {
    new Thread( new Runnable() {
        @Override public void run()  {
          while( true ) {
            try {
              // Try to get the NanoHTTP daemon started
              SERVER = new RequestServer(H2O._apiSocket);
              break;
            } catch( Exception ioe ) {
              Log.err(Sys.HTTPD,"Launching NanoHTTP server got ",ioe);
              try { Thread.sleep(1000); } catch( InterruptedException e ) { } // prevent denial-of-service
            }
          }
        }
      }, "Request Server launcher").start();
  }
1326703
public void start() {
        setStatus(ConnectionStatus.NOT_CONNECTED);
        InetSocketAddress address = directoryServer;
        clientSocket.connect(address);
        eventThread.start();
        connectionThread = new Thread(new ConnectTask());
        connectionThread.setDaemon(true);
        connectionThread.setName(ServiceDirectoryThread.getThreadName("Client_Connect_Thread"));
        connectionThread.start();
    }
510579
public function start()
    {
        // Linsten http Event
        $this->server->on('request', [$this, 'onRequest']);

        $this->server->on('start', [$this, 'onStart']);
        $this->server->on('shutdown', [$this, 'onShutdown']);

        $this->server->on('workerStart', [$this, 'onWorkerStart']);
        $this->server->on('workerStop', [$this, 'onWorkerStop']);
        $this->server->on('workerError', [$this, 'onWorkerError']);

        // listen websocket
        if ( !empty($this->config['enable_websocket']) ) {
            $this->server->on('open', [$this, 'onOpen']);
            $this->server->on('message', [$this, 'onMessage']);
            $this->server->on('close', [$this, 'onClose']);
        }

        // Add event Listener
        $this->add_event_listener('onBoot');

        // Start a new http server
        $this->server->start();
    }
247676
def start(self):
        """"""
        if self.state != STATE_RUNNING:
            conn = self.loop.create_connection(
                lambda: self, self.host, self.port)
            task = self.loop.create_task(conn)
            task.add_done_callback(self.init_done)
            self.state = STATE_STARTING
320002
public function start()
    {
        RequestContext::destroy();
        PoolManager::clearPools();
        CacheManager::clearPools();
        App::createServers();
        ServerManage::getServer('main')->getSwooleServer()->start();
    }
1330837
async def start(self, **kwargs):
        """"""
        zeroconf = kwargs['zeroconf']
        self._name = kwargs['name']
        self._pairing_guid = kwargs.get('pairing_guid', None) or \
            self._generate_random_guid()

        self._web_server = web.Server(self.handle_request, loop=self._loop)
        self._server = await self._loop.create_server(
            self._web_server, '0.0.0.0')

        # Get the allocated (random port) and include it in zeroconf service
        allocated_port = self._server.sockets[0].getsockname()[1]
        _LOGGER.debug('Started pairing web server at port %d', allocated_port)

        self._setup_zeroconf(zeroconf, allocated_port)
819027
def server(**kwargs):
    
    start_server(**{k: v for k, v in kwargs.items() if v},
                 blocking=True)
737565
def start_server(self):
        """"""
        if self.server is None:
            self.port = select_port(default_port=self.DEFAULT_PORT)
            self.set_home_url('http://localhost:%d/' % self.port)
        elif self.server.isRunning():
            self.server.server_started.disconnect(self.initialize_continued)
            self.server.quit()
        self.server = PydocServer(port=self.port)
        self.server.server_started.connect(self.initialize_continued)
        self.server.start()
386517
def start(self):
        
        if self._with_discovery:
            # Start the server to listen to new devices
            self.upnp.server.set_spawn(2)
            self.upnp.server.start()
        if self._with_subscribers:
            # Start the server to listen to events
            self.registry.server.set_spawn(2)
            self.registry.server.start()
667097
async function start() {
  const mainRoute = server.addReactRoute(
    "",
    path.resolve(process.cwd(), "app/Routes.js")
  );

  await server.start(); //start server
  console.log("started");
}
759245
def launch_server():
    
    print(os.path.dirname(os.path.abspath(__file__)))
    cur_dir = os.getcwd()
    path = os.path.dirname(os.path.abspath(__file__))
    run = True
    os.chdir(path)
    os.system('python manage.py runserver --nostatic')
    os.chdir(cur_dir)
735460
def start_wsgi_server(port, addr='', registry=REGISTRY):
    """"""
    app = make_wsgi_app(registry)
    httpd = make_server(addr, port, app, handler_class=_SilentHandler)
    t = threading.Thread(target=httpd.serve_forever)
    t.daemon = True
    t.start()
1060845
def _start(self):
        """"""
        assert self._tempdir is not None
        assert self._process is None
        self._process = subprocess.Popen(
            [
                self.paths.slapd,
                '-f', self._slapd_conf,
                '-h', self.uri,
                '-d', str(self.slapd_debug),
            ],
            stdout=sys.stdout,
            stderr=sys.stderr,
        )
        self._poll_slapd(timeout=self.max_server_startup_delay)
749505
def start_server(self):
        
        if self._server is None:
            self._server = SimpleServer()
            self._server.createPV(prefix=self._options.prefix,
                                  pvdb={k: v.config for k, v in self.interface.bound_pvs.items()})
            self._driver = PropertyExposingDriver(interface=self.interface,
                                                  device_lock=self.device_lock)
            self._driver.process_pv_updates(force=True)

            self.log.info('Started serving PVs: %s',
                          ', '.join((self._options.prefix + pv for pv in
                                     self.interface.bound_pvs.keys())))
1099861
def start(self):
        
        if self._shutdown:
            raise ShutdownError()

        self.read_watcher.start()
        logger.info("server started listening on {}".format(self.address))