PythonPusherClient icon indicating copy to clipboard operation
PythonPusherClient copied to clipboard

Handling Connection Close

Open joders opened this issue 6 years ago • 0 comments

The server I'm connecting to seems to close the connection after some time. I would like to handle this event (re-establishing the connection). From what I can see in the code pusherclient doesn't seem to expose the close handler of websocket-client WebSocketApp. Instead only a log is written and timers stopped via the following code:

    def _on_close(self, ws, *args):
        self.logger.info("Connection: Connection closed")
        self.state = "disconnected"
        self._stop_timers()

Is there a way to handle the connection close with pusherclient without modifying it?

joders avatar Dec 28 '18 09:12 joders