Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
taras committed Oct 10, 2024
1 parent ad87cd0 commit 1ad315d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/source/guides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ it does not handle replying to incoming ``PING`` frames.
...
Measuring/checking round-trip time
----------------------------------
**picows** allows to conveniently measure round-trip time to a remote peer using
:any:`measure_roundtrip_time`. This is done by sending PING request multiple
times and measuring response delay.

Checkout an `example <https://raw.githubusercontent.com/tarasko/picows/master/examples/okx_roundtrip_time.py>`_
of how to measure RTT to a popular OKX crypto-currency exchange and initiate
reconnect if it doesn't satisfy a predefined threshold.

Message fragmentation
---------------------
In the WebSocket protocol, there is a distinction between messages and frames.
Expand Down
2 changes: 1 addition & 1 deletion picows/picows.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ cdef class WSTransport:
Coroutine that measures roundtrip time by running ping-pong.
:param rounds: how many ping-pong rounds to do
:return: List of measured roundtrip times
:return: list of measured roundtrip times
"""

cdef double ping_at
Expand Down

0 comments on commit 1ad315d

Please sign in to comment.