Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

use native websocket ping frames rather than JSON ping #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ligfx
Copy link
Contributor

@ligfx ligfx commented Jan 25, 2021

Code was sending a JSON message {"ping":"0123456789"} to test if the connection was still open — WebSocket has native support for this.

This is easier for clients as the native ping frames are usually handled automatically by the WebSocket library.

Note that gevent-websocket doesn't automatically send out ping frames to keep the connection alive, which servers are supposed to do. It might be worth switching to another WebSocket library in the future that is more compliant.

Code was sending a JSON message {"ping":"0123456789"} to test if
the connection was still open — WebSocket has native support for
this.

This is easier for clients as the native ping frames are usually
handled automatically by the WebSocket library.

Note that gevent-websocket doesn't automatically send out ping
frames to keep the connection alive, which servers are supposed
to do. It might be worth switching to another WebSocket library
in the future that is more compliant.
@KeyboardInterrupt KeyboardInterrupt self-requested a review December 21, 2021 17:43
@KeyboardInterrupt KeyboardInterrupt self-assigned this Dec 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants