-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
Some servers, like the OKX WebSocket server, require clients to send a ping message every 30 seconds:
To maintain a stable connection:
- Set a timer for N seconds upon receiving a response, where N is less than 30.
- If the timer expires without receiving a new message, send the string 'ping'.
- Expect a 'pong' reply. If no response is received within N seconds, raise an error or reconnect.
Similarly, the Bybit WebSocket server recommends sending a ping heartbeat every 20 seconds to prevent network or program issues.
How can this be achieved using picows? I previously used websockets, which handled this automatically. I would really appreciate it if you could provide an example of how to implement this mechanism.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels