|
@@ -77,7 +77,7 @@ class LORANode(object): |
|
|
origstate = self.st.copy() |
|
|
origstate = self.st.copy() |
|
|
|
|
|
|
|
|
while True: |
|
|
while True: |
|
|
resp = await self.sd.sendtillrecv(msg, 1) |
|
|
|
|
|
|
|
|
resp = await self.sd.sendtillrecv(msg, .25) |
|
|
#_debprint('got:', resp) |
|
|
#_debprint('got:', resp) |
|
|
|
|
|
|
|
|
# skip empty messages |
|
|
# skip empty messages |
|
@@ -133,7 +133,7 @@ class SyncDatagram(object): |
|
|
async def recv(self, timeout=None): #pragma: no cover |
|
|
async def recv(self, timeout=None): #pragma: no cover |
|
|
'''Receive a datagram. If timeout is not None, wait that many |
|
|
'''Receive a datagram. If timeout is not None, wait that many |
|
|
seconds, and if nothing is received in that time, raise an |
|
|
seconds, and if nothing is received in that time, raise an |
|
|
TimeoutError exception.''' |
|
|
|
|
|
|
|
|
asyncio.TimeoutError exception.''' |
|
|
|
|
|
|
|
|
raise NotImplementedError |
|
|
raise NotImplementedError |
|
|
|
|
|
|
|
@@ -151,7 +151,7 @@ class SyncDatagram(object): |
|
|
await self.send(data) |
|
|
await self.send(data) |
|
|
try: |
|
|
try: |
|
|
return await self.recv(freq) |
|
|
return await self.recv(freq) |
|
|
except TimeoutError: |
|
|
|
|
|
|
|
|
except asyncio.TimeoutError: |
|
|
pass |
|
|
pass |
|
|
|
|
|
|
|
|
class MulticastSyncDatagram(SyncDatagram): |
|
|
class MulticastSyncDatagram(SyncDatagram): |
|
@@ -340,7 +340,7 @@ class TestSyncData(unittest.IsolatedAsyncioTestCase): |
|
|
class MySync(SyncDatagram): |
|
|
class MySync(SyncDatagram): |
|
|
def __init__(self): |
|
|
def __init__(self): |
|
|
self.sendq = [] |
|
|
self.sendq = [] |
|
|
self.resp = [ TimeoutError(), b'a' ] |
|
|
|
|
|
|
|
|
self.resp = [ asyncio.TimeoutError(), b'a' ] |
|
|
|
|
|
|
|
|
async def recv(self, timeout=None): |
|
|
async def recv(self, timeout=None): |
|
|
assert timeout == 1 |
|
|
assert timeout == 1 |
|
|