2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-26 03:38:25 +08:00

pc_rpc: use ProactorEventLoop on Windows (#627)

This commit is contained in:
Sebastien Bourdeauducq 2016-11-24 10:18:27 +08:00
parent ebae6d248f
commit 072e7f6628

View File

@ -11,6 +11,7 @@ client passes a list as a parameter of an RPC method, and that method
client's list. client's list.
""" """
import os
import socket import socket
import asyncio import asyncio
import threading import threading
@ -580,7 +581,11 @@ def simple_server_loop(targets, host, port, description=None):
See ``Server`` for a description of the parameters. 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: try:
server = Server(targets, description, True) server = Server(targets, description, True)
loop.run_until_complete(server.start(host, port)) loop.run_until_complete(server.start(host, port))