From 2e819f7c5e0fb6352908ca88ff09b3465023767c Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 4 Sep 2026 01:47:34 +0200 Subject: fix(node): select the Windows-compatible event loop before asyncio.run aiortc's ICE stack does not run on Windows' default ProactorEventLoop -- a DataChannel handshake never completes. `platform.use_compatible_event_loop()` switches to the SelectorEventLoop on win32, called at the top of `main()` before `asyncio.run()`. No-op off Windows. Known cost, for when the node runs on Windows: the SelectorEventLoop cannot spawn subprocesses, so ffmpeg streaming (asyncio.create_subprocess_exec in webrtc_server.py) needs a thread-based runner there. Tracked separately. Co-Authored-By: Claude Sonnet 5 --- packages/meshbay-node/src/meshbay_node/daemon.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/meshbay-node/src/meshbay_node/daemon.py') diff --git a/packages/meshbay-node/src/meshbay_node/daemon.py b/packages/meshbay-node/src/meshbay_node/daemon.py index 47241cd..d616b0c 100644 --- a/packages/meshbay-node/src/meshbay_node/daemon.py +++ b/packages/meshbay-node/src/meshbay_node/daemon.py @@ -1634,6 +1634,9 @@ def _systemctl_user(verb: str, unit: str, *, not_running_hint: str, def main() -> None: import argparse + from meshbay_node.platform import use_compatible_event_loop + use_compatible_event_loop() + parser = argparse.ArgumentParser(description="MeshBay Node daemon") parser.add_argument("command", nargs="?", choices=["init", "reset", "status", "gek-init", -- cgit v1.2.3