phase0:Built-in server support
322114
public static function SupportBuiltInServer () {
		$backtrace = debug_backtrace();
		$htdocs = dirname(str_replace(\DIRECTORY_SEPARATOR, '/', array_pop($backtrace)['file']));
		$_SERVER['DOCUMENT_ROOT'] = $htdocs;

		$static_path = sprintf('%s/%s', $htdocs, ltrim($_SERVER['SCRIPT_NAME'], '/'));

		clearstatcache($static_path, true);
		if (substr($_SERVER['SCRIPT_NAME'], -1. -3) !== '.php' && file_exists($static_path)) {
			return false;
		}

		return true;
	}
1370106
protected void startServerImpl() {
        SelendroidLogger.info("*** ServerInstrumentation#startServerImpl() ***");
        if (serverThread != null && serverThread.isAlive()) {
            return;
        }

        if (serverThread != null) {
            stopServer();
        }

        serverThread = new HttpdThread(this, serverPort);
        serverThread.startServer();
    }
737242
def serve
      server_options = {}
      options.each { |k, v| server_options[k.to_sym] = v }
      server_options[:server] = {}
      [:port, :handler, :host].each do |k|
        server_options[:server][k] = server_options.delete(k) if server_options.key?(k)
      end

      @project.server.set_options(server_options[:server])
    end
1185830
function FederationServer(bus, options) {
  events.EventEmitter.call(this);
  this.bus = bus;
  this.logger = bus.logger.withTag(bus.id + ':fedserver');
  this._options(options);
}
1355065
def server_setup(working_dir, port=None, api_port=None, indexer_enabled=None, indexer_url=None, api_enabled=None, recover=False):
    
    if not is_genesis_block_instantiated():
        # default genesis block
        genesis_block_load()

    blockstack_opts = get_blockstack_opts()
    blockstack_api_opts = get_blockstack_api_opts()
    pid_file = get_pidfile_path(working_dir)

    indexer_enabled = indexer_enabled if indexer_enabled is not None else blockstack_opts['enabled']
    api_enabled = api_enabled if api_enabled is not None else blockstack_api_opts['enabled']
    indexer_url = indexer_url if indexer_url is not None else blockstack_api_opts.get('indexer_url', None)

    # sanity check 
    if api_enabled and not indexer_url:
        print("FATAL: no 'indexer_url' in the config file, and no --indexer_url given in the arguments")
        sys.exit(1)

    if port is None:
        port = blockstack_opts['rpc_port']

    if api_port is None:
        api_port = blockstack_api_opts['api_port']

    # set up signals
    signal.signal( signal.SIGINT, blockstack_signal_handler )
    signal.signal( signal.SIGQUIT, blockstack_signal_handler )
    signal.signal( signal.SIGTERM, blockstack_signal_handler )

    # put pid file
    put_pidfile(pid_file, os.getpid())

    # clear indexing state
    set_indexing(working_dir, False)

    # process overrides
    if blockstack_opts['enabled'] != indexer_enabled:
        log.debug("Override blockstack.enabled to {}".format(indexer_enabled))
        blockstack_opts['enabled'] = indexer_enabled
        set_blockstack_opts(blockstack_opts)

    if blockstack_api_opts['enabled'] != api_enabled:
        log.debug("Override blockstack-api.enabled to {}".format(indexer_enabled))
        blockstack_api_opts['enabled'] = api_enabled
        set_blockstack_api_opts(blockstack_api_opts)

    if blockstack_api_opts['indexer_url'] != indexer_url:
        log.debug("Override blockstack-api.indexer_url to {}".format(indexer_url))
        blockstack_api_opts['indexer_url'] = indexer_url
        set_blockstack_api_opts(blockstack_api_opts)

    # start API servers
    rpc_srv = None
    api_srv = None
    atlas_state = None
    subdomain_state = None

    if blockstack_opts['enabled']:
        # get db state
        db = get_or_instantiate_db_state(working_dir)
    
        # set up atlas state, if we're an indexer
        atlas_state = atlas_init(blockstack_opts, db, port=port, recover=recover)
        db.close()

        # set up subdomains state
        subdomain_state = subdomains_init(blockstack_opts, working_dir, atlas_state)
    
        # start atlas node
        if atlas_state:
            atlas_node_start(atlas_state)
        
        # start back-plane API server
        rpc_srv = rpc_start(working_dir, port, subdomain_index=subdomain_state, thread=False)

    if blockstack_api_opts['enabled']:
        # start public RESTful API server
        api_srv = api_start(working_dir, blockstack_api_opts['api_host'], api_port, thread=False)

    if rpc_srv:
        rpc_srv.start()

    if api_srv:
        api_srv.start()

    # start GC
    gc_start()

    set_running(True)

    # clear any stale indexing state
    set_indexing(working_dir, False)

    log.debug("Server setup: API = {}, Indexer = {}, Indexer URL = {}".format(blockstack_api_opts['enabled'], blockstack_opts['enabled'], blockstack_api_opts['indexer_url']))

    ret = {
        'working_dir': working_dir,
        'atlas': atlas_state,
        'subdomains': subdomain_state,
        'subdomains_initialized': False,
        'rpc': rpc_srv,
        'api': api_srv,
        'pid_file': pid_file,
        'port': port,
        'api_port': api_port
    }

    return ret
532808
def server(self, ):
        
        c = connection.ServerConnection3(self)
        with self.mutex:
            self.connections.append(c)
        return c
350995
function getServerPreProcessing(request, reply) {
    var me = this;

    return function (routeInfo, page, model) {
        if (!page.serverPreprocessing) { return false; }

        var deps = { request: request, reply: reply, model: model, routeInfo: routeInfo };
        return me.pancakes.cook(page.serverPreprocessing, { dependencies: deps });
    };
}
949080
def simple(application, host='127.0.0.1', port=8080):
	
	
	# Try to be handy as many terminals allow clicking links.
	print("serving on http://{0}:{1}".format(host, port))
	
	# Bind and launch the server; this is a blocking operation.
	make_server(host, int(port), application).serve_forever()
845646
function configureDevServer(config) {
  if (borela !== 'serve')
    return
  config.devServer = {
    contentBase: PROJECT_BUILD_DIR,
    headers: {
      'Access-Control-Allow-Headers': '*',
      'Access-Control-Allow-Methods': '*',
      'Access-Control-Allow-Origin': '*',
    },
    index: 'index.html',
    stats: config.stats,
    watchContentBase: true,
    port,
  }
}
543478
function NetworkServer(server) {
  this.server = server;
  function connection(socket) {
    server.connection(socket, this);
  }
  this.on('connection', connection);
}
782801
public static void main(String[] args) throws IOException, InterruptedException {
    final CustomHeaderServer server = new CustomHeaderServer();
    server.start();
    server.blockUntilShutdown();
  }
55018
function Server(transport, keyFilePath, crtFilePath) {
	X224.call(this, transport);
	this.keyFilePath = keyFilePath;
	this.crtFilePath = crtFilePath;
	var self = this;
	this.transport.once('data', function (s) {
		self.recvConnectionRequest(s);
	});
}
1341383
def server(port):
    """"""
    args = ['python', 'manage.py', 'runserver']
    if port:
        args.append(port)
    run.main(args)
1226141
def server(addr):
        """"""
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        sock.bind(addr)
        sock.listen(1)
        conn, addr = sock.accept()
        talk = SocketTalk(conn)
        return talk
617175
def _build_ftp_processor(cls, session: AppSession):
        ''''''
        ftp_client = session.factory['FTPClient']

        fetch_params = session.factory.new(
            'FTPProcessorFetchParams',
            remove_listing=session.args.remove_listing,
            retr_symlinks=session.args.retr_symlinks,
            preserve_permissions=session.args.preserve_permissions,
            glob=session.args.glob,
        )

        return session.factory.new(
            'FTPProcessor',
            ftp_client,
            fetch_params,
        )
164199
def cli(env, identifier, wait):
    """"""

    compute = SoftLayer.HardwareManager(env.client)
    compute_id = helpers.resolve_id(compute.resolve_ids, identifier,
                                    'hardware')
    ready = compute.wait_for_ready(compute_id, wait)
    if ready:
        env.fout("READY")
    else:
        raise exceptions.CLIAbort("Server %s not ready" % compute_id)
566286
function Server(srv, opts){
  if (!(this instanceof Server)) return new Server(srv, opts);
  if ('object' == typeof srv && srv instanceof Object && !srv.listen) {
    opts = srv;
    srv = null;
  }
  opts = opts || {};
  this.nsps = {};
  this.parentNsps = new Map();
  this.path(opts.path || '/socket.io');
  this.serveClient(false !== opts.serveClient);
  this.parser = opts.parser || parser;
  this.encoder = new this.parser.Encoder();
  this.adapter(opts.adapter || Adapter);
  this.origins(opts.origins || '*:*');
  this.sockets = this.of('/');
  if (srv) this.attach(srv, opts);
}