Lawouach / WebSocket-for-Python

WebSocket client and server library for Python 2 and 3 as well as PyPy (ws4py 0.5.1)
https://ws4py.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
1.12k stars 288 forks source link

How to stop connections to zombie clients? #264

Closed AlexisTM closed 4 years ago

AlexisTM commented 4 years ago

I am using cherrypy. I and would like to stop the server-side connection of unreachable clients.

I did not get how to set the frequency heartbeat_freq for all the clients thus tried to set up one Heartbeat for each client on connection without success.

    def opened(self):
        self.hb = websocket.Heartbeat(self, 2.0)

To reproduce zombies:

The only way to terminate the zombie is to restart WiFi, reopen a Websocket connection thus the other connection can finally fail (reachable again).