Files
2026-08-31 17:18:03 +08:00

21 lines
574 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""本地测试用 Zenoh Router(mode=router,监听 tcp/127.0.0.1:7447)。
替代 zenohd:环境无独立 router 二进制时,用 Python zenoh 开一个 router 节点,
供网关(peer + connect 7447)与 worker 进程共同接入。仅用于本地联调。
"""
import time
import zenoh
config = zenoh.Config()
config.insert_json5("mode", '"router"')
session = zenoh.open(config)
print(">>> zenoh router listening on tcp/127.0.0.1:7447", flush=True)
try:
while True:
time.sleep(3600)
except KeyboardInterrupt:
pass
finally:
session.close()