python-websockets / websockets

Library for building WebSocket servers and clients in Python
https://websockets.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
5.23k stars 519 forks source link

Documentation should clarify that keepalive is supported in async client only #1508

Closed MarshalX closed 2 months ago

MarshalX commented 2 months ago

This documentation page https://websockets.readthedocs.io/en/stable/topics/keepalive.html mentions about ping_interval and ping_timeout arguments which are only related to async version. I can not find something similar to this

https://github.com/python-websockets/websockets/blob/44ccee17c519ea1397ee28a8ac3a7d7685cd0b89/src/websockets/asyncio/connection.py#L718-L722

in sync version. Thank you!

aaugustin commented 2 months ago

Yes it isn't implemented in the sync version (yet). I'll add it to the docs.

aaugustin commented 2 months ago

FYI: https://websockets.readthedocs.io/en/stable/reference/features.html is an up-to-date list of which implementation supports which features.

MarshalX commented 2 months ago

These tables are awesome! It clarifies all the points. It would be nice to have it near the implementations list where the developer should choose which one to pick. We have that list right on the main page https://websockets.readthedocs.io/en/stable/index.html

Don’t worry about the opening and closing handshakes, pings and pongs

This statement also could lead to misunderstanding in the sync version until automatic ping and pongs are not implemented

I am glad that this feature will come to a sync version as well. Thank you!

aaugustin commented 2 months ago

It would be nice to have it near the implementations list

Added in d62e4237.

I am glad that this feature will come to a sync version

For clarity, I don't have a timeline for this — and I'm a bit afraid of adding a new thread for each connection — but it's on my TODO for the project.