~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Server
357278
function Server(/* [options], [connectionListener] */) {
    events.EventEmitter.call(this);
    var self = this;

    var options;
    if (typeof arguments[0] === 'function') {
        options = {};
        this.on('connection', arguments[0]);
    } else {
        options = arguments[0] || {};
        if (typeof arguments[1] === 'function') {
            this.on('connection', arguments[1]);
        }
    }

    this._server = net.createServer(options, this._handler.bind(this));
    this._server.on('listening', function () {
        self.emit('listening');
    })
    this._server.on('close', function () {
        self.emit('close');
    })
    this._server.on('error', function (e) {
        self.emit('error', e);
    });
}
427650
def set_server(self, server_pos, key, value):
        """"""
        self._server_list[server_pos][key] = value
1039606
def server(client_id, client_secret, redirect_uri)
      Googl::OAuth2::Server.new(client_id, client_secret, redirect_uri)
    end
160296
def do_server(self, arg):
        
        if arg['on']:
            self.server_on()
        elif arg['off']:
            self.server_off()
        elif arg['restart']:
            self.server_restart()
        elif arg['log']:
            self.server_log()
        else:
            self.help_server()
298309
function(servers, options) {
  this.servers = servers;
  this.seq = 0;
  this.options = merge(options || {},
      {failoverTime: 60, retries: 2, retry_delay: 0.2, expires: 0, logger: console});
}
900289
public function serverAction()
    {
        chdir($this->application->config('directory.document_root'));
        $host = $this->request->get('host', 'localhost');
        $port = $this->request->get('port', 8888);
        passthru(sprintf('php -S %s:%s index.php', $host, $port));
    }
1179378
function ( args, cb ) {
    var flags = {},
        commands = {};

    if ( !args || !args.length ) {
        printUsage();
    }

    for ( var i = 0, len = args.length; i < len; i++ ) {
        var arg = args[ i ],
            rFlag = /^--/,
            split;

        if ( rFlag.test( arg ) ) {
            split = arg.split( "=" );
            flags[ split[ 0 ].replace( rFlag, "" ) ] = (split[ 1 ] || true);

        } else {
            commands[ arg ] = true;
        }
    }

    // Silence is golden
    if ( flags.quiet ) {
        nsl.log( "server", "Squarespace server running in silent mode" );
        nsl.silence();
    }

    // Open website tab
    if ( flags.open ) {
        serverConfig.open = true;
    }

    // Set Squarespace authentication impersonation status.
    if ( flags.auth ) {
        serverConfig.auth = true;
    }

    // Order of operations
    if ( flags.version ) {
        printVersion();

    } else if ( commands.buster ) {
        sqsCache.clear();
        process.exit();

    } else if ( commands.server ) {
        if ( flags.port ) {
            flags.port = Number( flags.port );

            serverConfig.port = flags.port;
        }

        cb();
    }
}
310790
public function main()
    {
        $command = sprintf(
            'php -S %s:%d -t %s',
            $this->_host,
            $this->_port,
            escapeshellarg($this->_documentRoot)
        );

        if (!empty($this->_iniPath)) {
            $command = sprintf('%s -c %s', $command, $this->_iniPath);
        }

        $command = sprintf('%s %s', $command, escapeshellarg($this->_documentRoot . '/index.php'));

        $port = ':' . $this->_port;
        $this->out(sprintf('built-in server is running in http://%s%s/', $this->_host, $port));
        $this->out(sprintf('You can exit with <info>`CTRL-C`</info>'));
        system($command);
    }
548795
private Server setUpServer() {
        Server server = new Server(port);
        ResourceHandler handler = new ResourceHandler();
        handler.setDirectoriesListed(true);
        handler.setWelcomeFiles(new String[]{"index.html"});
        handler.setResourceBase(getReportDirectoryPath().toAbsolutePath().toString());
        HandlerList handlers = new HandlerList();
        handlers.setHandlers(new Handler[]{handler, new DefaultHandler()});
        server.setStopAtShutdown(true);
        server.setHandler(handlers);
        return server;
    }
226064
function Server(opts){
  // Shorthand, no "new" required.
  if (!(this instanceof Server))
    return new Server(...arguments);

  if (typeof opts !== 'object')
    opts = {};

  this.clients = opts.dummies || [];

  this.server = opts.server || new SocketServer(socket => {
    let client = new Client(socket);
    this.clients.push(client);
    this.emit('connection', client);

    client._socket.once('data', handshake.bind(client));
    client.on('handshake-done', () => {
      client._socket.on('data', message.bind(client));
    });
  });
}
1353361
public function run()
    {
        $stime = microtime(true);
        $this->header('Content-Type: text/html; charset=utf-8');
        ?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <title>Server status.</title>
        </head>
        <body>
        <br/>Uptime: <b><?php echo DateTime::diffAsText(Daemon::$startTime, time());
            ?></b>
        <br/><br/><b>State of workers:</b><?php $stat = Daemon::getStateOfWorkers();
        ?>
        <br/>Idle: <?php echo $stat['idle'];
        ?>
        <br/>Busy: <?php echo $stat['busy'];
        ?>
        <br/>Total alive: <?php echo $stat['alive'];
        ?>
        <br/>Shutdown: <?php echo $stat['shutdown'];
        ?>
        <br/>Pre-init: <?php echo $stat['preinit'];
        ?>
        <br/>Wait-init: <?php echo $stat['waitinit'];
        ?>
        <br/>Init: <?php echo $stat['init'];
        ?>
        <br/>
        <br/>Request took: <?php printf('%f', round(microtime(true) - $stime, 6));
        ?>
        </body>
        </html>
        <?php
    }
1318650
public final void server() {

    // load parameters into a properties
    String port = parsedArguments.getString("port");
    String model = parsedArguments.getString("model");
    String lemmatizerModel = parsedArguments.getString("lemmatizerModel");
    final String allMorphology = Boolean.toString(this.parsedArguments.getBoolean("allMorphology"));
    final String multiwords = Boolean.toString(this.parsedArguments
        .getBoolean("multiwords"));
    final String dictag = Boolean.toString(this.parsedArguments
        .getBoolean("dictag"));
    String outputFormat = parsedArguments.getString("outputFormat");
    // language parameter
    String lang = parsedArguments.getString("language");
    Properties serverproperties = setServerProperties(port, model, lemmatizerModel, lang, multiwords, dictag, outputFormat, allMorphology);
    new StatisticalTaggerServer(serverproperties);
  }
251158
public static function serve()
    {
        $output = new NullOutput();

        $daux = new Daux(Daux::LIVE_MODE, $output);
        $daux->initializeConfiguration();

        $class = $daux->getProcessorClass();
        if (!empty($class)) {
            $daux->setProcessor(new $class($daux, $output, 0));
        }

        // Set this critical configuration
        // for the tree generation
        $daux->getParams()['index_key'] = 'index';

        // Improve the tree with a processor
        $daux->generateTree();

        $server = new static($daux);

        try {
            $page = $server->handle();
        } catch (NotFoundException $e) {
            $page = new ErrorPage('An error occured', $e->getMessage(), $daux->getParams());
        }

        $server->createResponse($page)->prepare($server->request)->send();
    }
1318747
public function setServer(ServerInterface $server): void
    {
        $this->server = $server;
        $this->server->configure($this);
    }
1003588
public function start()
    {
        $httpServer = $this->getHttpServer();

        // 是否正在运行
        if ($httpServer->isRunning()) {
            $serverStatus = $httpServer->getServerSetting();

            \output()->writeln("<error>The server have been running!(PID: {$serverStatus['masterPid']})</error>", true, true);
        } else {
            $serverStatus = $httpServer->getServerSetting();
        }

        // 启动参数
        $this->setStartArgs($httpServer);
        $httpStatus = $httpServer->getHttpSetting();
        $tcpStatus = $httpServer->getTcpSetting();

        // Setting
        $workerNum = $httpServer->setting['worker_num'];

        // HTTP 启动参数
        $httpHost = $httpStatus['host'];
        $httpPort = $httpStatus['port'];
        $httpMode = $httpStatus['mode'];
        $httpType = $httpStatus['type'];

        // TCP 启动参数
        $tcpEnable = $serverStatus['tcpable'];
        $tcpHost = $tcpStatus['host'];
        $tcpPort = $tcpStatus['port'];
        $tcpType = $tcpStatus['type'];
        $tcpEnable = $tcpEnable ? '<info>Enabled</info>' : '<warning>Disabled</warning>';

        // 信息面板
        $lines = [
            '                         Server Information                      ',
            '********************************************************************',
            "* HTTP | host: <note>$httpHost</note>, port: <note>$httpPort</note>, type: <note>$httpType</note>, worker: <note>$workerNum</note>, mode: <note>$httpMode</note>",
            "* TCP  | host: <note>$tcpHost</note>, port: <note>$tcpPort</note>, type: <note>$tcpType</note>, worker: <note>$workerNum</note> ($tcpEnable)",
            '********************************************************************',
        ];

        // 启动服务器
        \output()->writeln(implode("\n", $lines));
        $httpServer->start();
    }
175149
def server(*names, &block)
            names.each do |name|
                server = @tool.provide_server(name)
                scope = Scope.new(self, server)
                if not block.nil? then
                    Docile.dsl_eval(scope, &block)
                end
            end
        end
1248940
function Server(options, requestListener) {
  if (!(this instanceof Server)) {
    return new Server(options, requestListener);
  }
  
    if (typeof options === 'function') {
      requestListener = options;
      options = {};
    } else if (options == null || typeof options === 'object') {
      options = util._extend({}, options);
    }
  
    options = Object.assign({
      server: null,
      token: null,
      id: null,
    }, options);

  if (!isDefinedAndNonNull(options, 'server')) {
    throw new TypeError('\'server\' must be provided');
  }

  if (!isDefinedAndNonNull(options, 'token')) {
    throw new TypeError('A \'token\' string or function must be provided');
  }

  var self = this;

  this.listenUri = options.server;
  if (isDefinedAndNonNull(options, 'id')) {
    this.listenUri = listenUri + '&id=' + options.id;
  }

  this.pendingRequest = null;
  this.closeRequested = false;
  this.options = options;
  this.path = options.path;
  this.clients = [];

  if (requestListener) {
    this.on('request', requestListener);
  }
  this.timeout = 2 * 60 * 1000;
  this.keepAliveTimeout = 5000;
  this.on('requestchannel', function(channel) { requestChannelListener(self, channel) });

}