I have set up callbacks for on_error, on_close and on_data (heartbeats) and there is a separate script always checking the outputs of these callbacks. If there the connection is closed, it restarts the websocket or if the heartbeat is not received for 5 seconds, it restarts the websocket. What I found for the last one week is that the program simply freezes without giving out any errors or it does not even close. It just hangs so that the on_close callback spits no output. Any pointers to what is possibly going wrong?