def run(self, host: str = "0.0.0.0", port: int = 5000) -> None:
        """
        debug run
        :param host: the hostname to listen on, default is ``'0.0.0.0'``
        :param port: the port of the server, default id ``5000``
        """
        loop = cast(asyncio.AbstractEventLoop, self._loop)
        listen = self.listen(host=host, port=port)
        server = loop.run_until_complete(listen)

        def close() -> None:
            """
            关闭回调
            """
            server.close()
            loop.stop()
        # print(type(server))
        loop.add_signal_handler(SIGTERM, close)
        loop.add_signal_handler(SIGINT, close)
        loop.run_forever()
def run ( self , host : str = "0.0.0.0" , port : int = 5000 ) -> None : loop = cast ( asyncio . AbstractEventLoop , self . _loop ) listen = self . listen ( host = host , port = port ) server = loop . run_until_complete ( listen ) def close ( ) -> None : server . close ( ) loop . stop ( ) loop . add_signal_handler ( SIGTERM , close ) loop . add_signal_handler ( SIGINT , close ) loop . run_forever ( )
debug run
        :param host: the hostname to listen on, default is ``'0.0.0.0'``
        :param port: the port of the server, default id ``5000``