Skip to content

Commit 2b37423

Browse files
committed
docs: correct the no-await invariant comment in _async_create_endpoints
1 parent 2d4b61b commit 2b37423

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/zeroconf/_engine.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ async def _async_create_endpoints(self) -> None:
151151

152152
for s in reader_sockets:
153153
reader = await self._async_wrap_socket(s, s in sender_sockets)
154-
# The wrap above does not await before returning, so releasing
155-
# the engine's pending handle here keeps ``s`` in exactly one
156-
# place from a concurrent shutdown's point of view.
154+
# _async_wrap_socket registers the transport with no await between
155+
# creating and registering it, and the pending-handle cleanup below
156+
# adds no await either, so a concurrent shutdown always sees ``s``
157+
# in exactly one place.
157158
if s is self._listen_socket:
158159
# Keep a handle to the shared listen socket so interface
159160
# rescans can add/drop multicast memberships on it.

0 commit comments

Comments
 (0)