Skip to content
Advertisement

Tag: ping

Python Websocket-Client Package Frequent Ping-Pong Timeouts Upon Too Many Subscriptions

I am using the python websocket-client package (https://pypi.org/project/websocket-client/) to subscribe to multiple websocket channels. I implemented the basic ping-pong logic using the websocket client package as below. The ping-pong logic is working mostly fine under normal circumstances and I am able to run the code for hours without many disconnect/reconnect instances. However, when I try to increase the number of

Pinging servers in Python

In Python, is there a way to ping a server through ICMP and return TRUE if the server responds, or FALSE if there is no response? Answer This function works in any OS (Unix, Linux, macOS, and Windows) Python 2 and Python 3 EDITS: By @radato os.system was replaced by subprocess.call. This avoids shell injection vulnerability in cases where your

Advertisement