aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/platform.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/platform.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/platform.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/platform.py b/packages/meshbay-node/src/meshbay_node/platform.py
index bc48169..4bd8e35 100644
--- a/packages/meshbay-node/src/meshbay_node/platform.py
+++ b/packages/meshbay-node/src/meshbay_node/platform.py
@@ -1,10 +1,29 @@
"""Platform-specific paths and tool resolution for meshbay-node."""
+import asyncio
import os
import shutil
import sys
from pathlib import Path
+# ── Event loop ───────────────────────────────────────────────────────────────
+
+
+def use_compatible_event_loop() -> None:
+ """
+ aiortc's ICE stack (aioice) does not run on Windows' default
+ ProactorEventLoop — a DataChannel handshake never completes and the
+ connection hangs. Select the SelectorEventLoop before the loop is created.
+
+ Cost: SelectorEventLoop cannot spawn subprocesses on Windows, so ffmpeg
+ streaming (asyncio.create_subprocess_exec in webrtc_server.py) does not work
+ under it. The video path needs a thread-based runner on Windows — tracked
+ for the port. No effect off Windows.
+ """
+ if sys.platform == "win32":
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
+
+
# ── Directories ──────────────────────────────────────────────────────────────