control.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:ave 作者: sonyxperiadev 项目源码 文件源码
def shutdown(self, details=None):
        '''
        Exit the main loop and write a last exit message on all connections
        before closing them. The exit message will be serialized as an ``Exit``
        exception.
        '''
        # close all open connections
        for connection in self.accepting:
            connection.close()
        for connection in self.authenticating:
            if details:
                self.write_exit_message(connection, details)
            connection.close()
        for connection in self.established:
            if details:
                self.write_exit_message(connection, details)
            connection.close()
        if self.listener:
            self.listener.close()
        self.join_deferred()
        os._exit(1) # causes queued messages on outbound sockets to be flushed
                    # in the background. Man page: socket(7) SO_LINGER
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号