Skip to content

Commit

Permalink
pc_rpc: use ProactorEventLoop on Windows (#627)
Browse files Browse the repository at this point in the history
sbourdeauducq committed Nov 24, 2016
1 parent dab19d2 commit 7d4297b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion artiq/protocols/pc_rpc.py
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
client's list.
"""

import os
import socket
import asyncio
import threading
@@ -592,7 +593,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))

0 comments on commit 7d4297b

Please sign in to comment.