Skip to content

Commit 4dd7aaa

Browse files
fixup! Adds TCP broker supporting zero-delimited frames
1 parent 8fbd9f8 commit 4dd7aaa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pycyphal/util/broker.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ async def read(self) -> t.AsyncGenerator[bytes, None]:
5050
def write(self, frame: bytes) -> None:
5151
"""
5252
Writes a frame to the stream, unless the stream is closing.
53+
54+
:param frame: Frame to send to this client.
5355
"""
5456
if self._writer.is_closing():
5557
return
@@ -68,8 +70,12 @@ async def serve_forever(host: str, port: int) -> None:
6870
"""
6971
pybroker core server loop.
7072
71-
Accept clients on :param:`host`::param:`port` and broadcast any frame
72-
received from any client to all other clients."""
73+
Accept clients on :code:`host`::code:`port` and broadcast any frame
74+
received from any client to all other clients.
75+
76+
:param host: IP, where the broker will be reachable on.
77+
:param port: port, on which the broker will listen on.
78+
"""
7379
clients: list[Client] = []
7480
list_lock = asyncio.Lock()
7581

0 commit comments

Comments
 (0)