From 072e7f66282b1f5b704a72a5d037641174be57bc Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 24 Nov 2016 10:18:27 +0800 Subject: [PATCH] pc_rpc: use ProactorEventLoop on Windows (#627) --- artiq/protocols/pc_rpc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/protocols/pc_rpc.py b/artiq/protocols/pc_rpc.py index ca3c356f2..8bf00ceb4 100644 --- a/artiq/protocols/pc_rpc.py +++ b/artiq/protocols/pc_rpc.py @@ -11,6 +11,7 @@ client passes a list as a parameter of an RPC method, and that method client's list. """ +import os import socket import asyncio import threading @@ -580,7 +581,11 @@ def simple_server_loop(targets, host, port, description=None): See ``Server`` for a description of the parameters. """ - loop = asyncio.get_event_loop() + if os.name == "nt": + loop = asyncio.ProactorEventLoop() + asyncio.set_event_loop(loop) + else: + loop = asyncio.get_event_loop() try: server = Server(targets, description, True) loop.run_until_complete(server.start(host, port))