Skip to content

Commit 7d4297b

Browse files
committedNov 24, 2016
pc_rpc: use ProactorEventLoop on Windows (#627)
1 parent dab19d2 commit 7d4297b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

Diff for: ‎artiq/protocols/pc_rpc.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
client's list.
1212
"""
1313

14+
import os
1415
import socket
1516
import asyncio
1617
import threading
@@ -592,7 +593,11 @@ def simple_server_loop(targets, host, port, description=None):
592593
593594
See ``Server`` for a description of the parameters.
594595
"""
595-
loop = asyncio.get_event_loop()
596+
if os.name == "nt":
597+
loop = asyncio.ProactorEventLoop()
598+
asyncio.set_event_loop(loop)
599+
else:
600+
loop = asyncio.get_event_loop()
596601
try:
597602
server = Server(targets, description, True)
598603
loop.run_until_complete(server.start(host, port))

0 commit comments

Comments
 (0)
Please sign in to comment.