This may fix "The semaphore timeout period has expired" error on Windows. #311.

This commit is contained in:
grossmj committed 2015-09-13 15:47:43 -06:00
1 parent 65fa4036c6
commit a9ac0d3380
2 files changed
+2 -24

No files matched your search

@@ -81,8 +81,8 @@ class DynamipsHypervisor:
while time.time() - begin < timeout:
yield from asyncio.sleep(0.01)
try:
self._reader, self._writer = yield from asyncio.open_connection(host, self._port)
except OSError as e:
self._reader, self._writer = yield from asyncio.wait_for(asyncio.open_connection(host, self._port), timeout=1)
except (asyncio.TimeoutError, OSError) as e:
last_exception = e
continue
connection_success = True
-22
View File
@@ -30,8 +30,6 @@ class NIO(object):
def __init__(self):
# create an unique name
self._name = 'nio-{}'.format(uuid.uuid4())
self._capturing = False
self._pcap_output_file = ""
self._pcap_data_link_type = ""
@@ -78,23 +76,3 @@ class NIO(object):
"""
return self._pcap_data_link_type
def __str__(self):
"""
NIO string representation.
:returns: NIO name
"""
return self._name
@property
def name(self):
"""
Returns the NIO name.
:returns: NIO name
"""
return self._name