def connection_close(self, protocol): print('?????????? ?? ????...') self.connection_lose_flag = True if reactor.running: reactor.stop()