Beispiel #1
0
    async def _start(self, loop):
        await listen(config.get(self.NAME, 'host_local'), config.get(self.NAME, 'port'))

        try:
            _backdoor_port = config.get(self.NAME, 'adminport')

            if isinstance(_backdoor_port, int) and _backdoor_port > 1024:
                from backdoor import listen as blisten
                await blisten(int(_backdoor_port))
            else:
                raise Exception('unknown backdoor port:{0}'.format(_backdoor_port))
        except Exception as e:
            log.warn('can not open backdoor. error:{0}'.format(e))

        load_all_routes(self.NAME)
Beispiel #2
0
    async def _start(self, loop):
        await listen('', config.get(self.NAME, 'port'))

        try:
            _backdoor_port = config.get(self.NAME, 'adminport')

            if isinstance(_backdoor_port, int) and _backdoor_port > 1024:
                from backdoor import listen as blisten
                await blisten(int(_backdoor_port))
            else:
                raise Exception('unknown backdoor port:{0}'.format(_backdoor_port))
        except Exception as e:
            log.warn('can not open backdoor. error:{0}'.format(e))

        load_all_routes(self.NAME)
        await self.connectGW()
        await self.connectCS()
        conf = config.get('REDIS')
        await redis.init(**conf)