Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions zeroconf/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@ def __init__(
if ip_version is None:
ip_version = autodetect_ip_version(interfaces)

# hook for threads
self._GLOBAL_DONE = False
self.done = False

if apple_p2p and sys.platform != 'darwin':
raise RuntimeError('Option `apple_p2p` is not supported on non-Apple platforms.')
Expand Down Expand Up @@ -456,10 +455,6 @@ async def async_wait_for_start(self) -> None:
"""Wait for start up."""
await self.engine.async_wait_for_start()

@property
def done(self) -> bool:
return self._GLOBAL_DONE

@property
def listeners(self) -> List[RecordUpdateListener]:
return self.record_manager.listeners
Expand Down Expand Up @@ -815,7 +810,7 @@ def async_send(
transport: Optional[asyncio.DatagramTransport] = None,
) -> None:
"""Sends an outgoing packet."""
if self._GLOBAL_DONE:
if self.done:
return

# If no transport is specified, we send to all the ones
Expand Down Expand Up @@ -866,10 +861,10 @@ def _async_send_transport(

def _close(self) -> None:
"""Set global done and remove all service listeners."""
if self._GLOBAL_DONE:
if self.done:
return
self.remove_all_service_listeners()
self._GLOBAL_DONE = True
self.done = True

def _shutdown_threads(self) -> None:
"""Shutdown any threads."""
Expand Down