Start sirbot

        Configure sirbot and start the aiohttp.web.Application

        Args:
            host (str): host
            port (int): port
330688
def run(self, host: str = '0.0.0.0', port: int = 8080):
        
        self._loop.run_until_complete(self._configure_plugins())
        web.run_app(self._app, host=host, port=port)
202648
def start_server(self, addr='', port=8000):
        
        if self._multiprocess_on:
            raise SanicPrometheusError(
                "start_server can not be used when multiprocessing " +
                "is turned on")
        start_http_server(addr=addr, port=port)
1182772
def flaskrun(app, default_host="127.0.0.1", default_port="8000"):
    

    # Set up the command-line options
    parser = optparse.OptionParser()
    parser.add_option(
        "-H",
        "--host",
        help="Hostname of the Flask app " + "[default %s]" % default_host,
        default=default_host,
    )
    parser.add_option(
        "-P",
        "--port",
        help="Port for the Flask app " + "[default %s]" % default_port,
        default=default_port,
    )

    # Two options useful for debugging purposes, but
    # a bit dangerous so not exposed in the help message.
    parser.add_option(
        "-d", "--debug", action="store_true", dest="debug", help=optparse.SUPPRESS_HELP
    )
    parser.add_option(
        "-p",
        "--profile",
        action="store_true",
        dest="profile",
        help=optparse.SUPPRESS_HELP,
    )

    options, _ = parser.parse_args()

    # If the user selects the profiling option, then we need
    # to do a little extra setup
    if options.profile:
        from werkzeug.contrib.profiler import ProfilerMiddleware

        app.config["PROFILE"] = True
        app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30])
        options.debug = True

    app.run(debug=options.debug, host=options.host, port=int(options.port))
615005
def enable_host_event_handler(self, host):
        
        if not host.event_handler_enabled:
            host.modified_attributes |= \
                DICT_MODATTR["MODATTR_EVENT_HANDLER_ENABLED"].value
            host.event_handler_enabled = True
            self.send_an_element(host.get_update_status_brok())
1171048
def _start(self):
        '''

        '''
        if self.whoami is None:
            me = self.get_me()
            if me.get('ok', False):
                self.whoami = me['result']
            else:
                raise ValueError('Bot Cannot request information, check '
                                 'api_key')
960102
def create(host, port):
    
    wrapper = WrapperEchoServer({
        'server': None
    })
    d = {
        'listen_port': port,
        'changer': wrapper
    }
    if host:
        d['listen_bind_ip'] = host

    ses = EchoServer(d)
    wrapper.server = ses
    return [wrapper], cmd_line
1046320
def start_server(self, host='localhost', port=9000, app=None):
        """"""
        from wsgiref.simple_server import make_server
        if app is None:
            app = self.wsgi
        server = make_server(host, port, app)
        server_addr = "%s:%s" % (server.server_name, server.server_port)
        print "Server listening at http://%s/" % server_addr
        server.serve_forever()
749124
def _start_http(self):
        
        log.debug("Forward HTTP for %s to %d", self.name, self._console_http_port)
        command = ["docker", "exec", "-i", self._cid, "/gns3/bin/busybox", "nc", "127.0.0.1", str(self._console_http_port)]
        # We replace host and port in the server answer otherwise some link could be broken
        server = AsyncioRawCommandServer(command, replaces=[
            (
                '://127.0.0.1'.encode(),  # {{HOST}} mean client host
                '://{{HOST}}'.encode(),
            ),
            (
                ':{}'.format(self._console_http_port).encode(),
                ':{}'.format(self.console).encode(),
            )
        ])
        self._telnet_servers.append((yield from asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)))
175033
def run(self):
        
        server_address = (self.host, self.port)
        threading = True
        if threading:
            httpd_cls = type('WSGIServer', (ThreadingMixIn, WSGIServer), {})
        else:
            httpd_cls = WSGIServer
        self.httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=False)
        wsgi_handler = get_internal_wsgi_application()
        self.httpd.set_app(wsgi_handler)
        self.is_ready.set()
        self.httpd.serve_forever()
1254868
def start(self, host="localhost", port=8999, disks=None):
        
        disks = [] if disks is None else disks

        args = {
            "host": host,
            "port": port,
            "disks": disks
        }
        self._rtinfo_start_params_chk.check(args)

        return self._client.json("rtinfo.start", args)
616360
def run(self):
        
        self._connect()
        super(irc.bot.SingleServerIRCBot, self).start()
258643
def connect(self, host, port):
        
        if not port and (host.find(':') == host.rfind(':')):
            i = host.rfind(':')
            if i >= 0:
                host, port = host[:i], host[i+1:]
            try: port = int(port)
            except ValueError:
                raise socket.error, "nonnumeric port"
        #if self.verbose > 0:
        #    print 'connect:', (host, port)
        msg = "getaddrinfo returns an empty list"
        self.sock = None
        for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
            af, socktype, proto, canonname, sa = res
            try:
                self.sock = socket.socket(af, socktype, proto)
                #if self.debuglevel > 0: print 'connect:', (host, port)
                self.sock.connect(sa)
            except socket.error, msg:
                #if self.debuglevel > 0: print 'connect fail:', (host, port)
                self.close()
                continue
            break
        if not self.sock:
            raise socket.error, msg
453964
def _main():
    ''' 
    '''
    global listener

    if len(_sys.argv) < 2 or _sys.argv[1] == '--help':
        print("Usage: %s host http_port [https_port certfile keyfile]" % \
              _sys.argv[0])
        _sys.exit(2)

    logging.basicConfig(stream=_sys.stderr, level=logging.INFO,
                        format='%(asctime)s %(levelname)s: %(message)s')

    host = _get_argv(1)
    http_port = _get_argv(2)
    https_port = _get_argv(3)
    certfile = _get_argv(4)
    keyfile = _get_argv(5)

    listener = pywbem.WBEMListener(host=host,
                                   http_port=http_port,
                                   https_port=https_port,
                                   certfile=certfile,
                                   keyfile=keyfile)

    listener.add_callback(_process_indication)
    listener.start()


    banner = """
WBEM listener started on host %s (HTTP port: %s, HTTPS port: %s).
This Python console displays any indications received by this listener as
logger outputs (Level=INFO) to the console by default.

listener: WBEMListener instance that has been started.

help(listener): Display help for using listener instance.

status() : Display count of indications received; status(reset=True) to reset
           counters

Modify logger characteristics through listener.logger:
     (ex. listener.logger.setLevel(logging.ERROR))

Ctrl-d to exit
""" % (host, http_port, https_port)

    # Determine file path of history file
    home_dir = '.'
    if 'HOME' in _os.environ:
        home_dir = _os.environ['HOME'] # Linux
    elif 'HOMEPATH' in _os.environ:
        home_dir = _os.environ['HOMEPATH'] # Windows
    histfile = '%s/.listen_history' % home_dir

    # Read previous command line history
    if _HAVE_READLINE:
        NotFoundError = getattr(__builtins__, 'FileNotFoundError', IOError)
        try:
            _readline.read_history_file(histfile)
        except NotFoundError as exc:
            if exc.errno != _errno.ENOENT:
                raise

    # Interact
    i = _code.InteractiveConsole(globals())
    i.interact(banner)

    # Save command line history
    if _HAVE_READLINE:
        _readline.write_history_file(histfile)

    return 0
535985
def start(host, port=5959, tag='salt/engine/logstash', proto='udp'):
    '''
    
    '''

    if proto == 'tcp':
        logstashHandler = logstash.TCPLogstashHandler
    elif proto == 'udp':
        logstashHandler = logstash.UDPLogstashHandler

    logstash_logger = logging.getLogger('python-logstash-logger')
    logstash_logger.setLevel(logging.INFO)
    logstash_logger.addHandler(logstashHandler(host, port, version=1))

    if __opts__.get('id').endswith('_master'):
        event_bus = salt.utils.event.get_master_event(
                __opts__,
                __opts__['sock_dir'],
                listen=True)
    else:
        event_bus = salt.utils.event.get_event(
            'minion',
            transport=__opts__['transport'],
            opts=__opts__,
            sock_dir=__opts__['sock_dir'],
            listen=True)
        log.debug('Logstash engine started')

    while True:
        event = event_bus.get_event()
        if event:
            logstash_logger.info(tag, extra=event)
154744
def serve(self, liveport=None, host=None, restart_delay=2):
        
        host = host or '127.0.0.1'
        logger.info('Serving on http://%s:%s' % (host, liveport))

        self.application(host, liveport=liveport)

        try:
            self.watcher._changes.append(('__livereload__', restart_delay))
            LiveReloadHandler.start_tasks()
            IOLoop.instance().start()
        except KeyboardInterrupt:
            logger.info('Shutting down...')
777205
async def start(self):
        
        logging.info('Starting server, listening on %s.', self.port)
        runner = web.AppRunner(self)
        await runner.setup()
        site = web.TCPSite(runner, '', self.port)
        await site.start()
31691
function start() {
      // Listen to the port
      app.listen(hrsConfigs.port, function (err) {
        if (err) {
          info(err);
        }
        info('Running on http://%s:%s', hrsConfigs.address, hrsConfigs.port);
      });
    }