aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/daemon.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-04 01:47:34 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-04 01:47:34 +0200
commit2e819f7c5e0fb6352908ca88ff09b3465023767c (patch)
treee19138228ea188f47eafae3ba1e0eb1cb721eb09 /packages/meshbay-node/src/meshbay_node/daemon.py
parenta5255ec984098579d400a631fdf3a2571cb0ca79 (diff)
downloadmeshbay-2e819f7c5e0fb6352908ca88ff09b3465023767c.tar.gz
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/daemon.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/daemon.py3
1 files changed, 3 insertions, 0 deletions
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",