forked from M-Labs/artiq
pc_rpc: use ProactorEventLoop on Windows (#627)
This commit is contained in:
parent
ebae6d248f
commit
072e7f6628
|
@ -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,6 +581,10 @@ def simple_server_loop(targets, host, port, description=None):
|
|||
|
||||
See ``Server`` for a description of the parameters.
|
||||
"""
|
||||
if os.name == "nt":
|
||||
loop = asyncio.ProactorEventLoop()
|
||||
asyncio.set_event_loop(loop)
|
||||
else:
|
||||
loop = asyncio.get_event_loop()
|
||||
try:
|
||||
server = Server(targets, description, True)
|
||||
|
|
Loading…
Reference in New Issue