mirror of https://github.com/DJ2LS/FreeDATA.git
Fix hangs on ARQ sessions
parent
5d8554df08
commit
1027ea1b98
|
@ -70,12 +70,13 @@ class ARQSessionIRS(arq_session.ARQSession):
|
|||
return match
|
||||
|
||||
def transmit_and_wait(self, frame, timeout, mode):
|
||||
self.event_frame_received.clear()
|
||||
self.transmit_frame(frame, mode)
|
||||
self.log(f"Waiting {timeout} seconds...")
|
||||
if not self.event_frame_received.wait(timeout):
|
||||
self.log("Timeout waiting for ISS. Session failed.")
|
||||
self.set_state(IRS_State.FAILED)
|
||||
self.event_manager.send_arq_finished(False, self.id, self.dxcall, self.total_length, False)
|
||||
self.event_manager.send_arq_session_finished(False, self.id, self.dxcall, self.total_length, False)
|
||||
|
||||
def launch_transmit_and_wait(self, frame, timeout, mode):
|
||||
thread_wait = threading.Thread(target = self.transmit_and_wait,
|
||||
|
|
|
@ -60,6 +60,7 @@ class ARQSessionISS(arq_session.ARQSession):
|
|||
else: burst = [frame_or_burst]
|
||||
for f in burst:
|
||||
self.transmit_frame(f, mode)
|
||||
self.event_frame_received.clear()
|
||||
self.log(f"Waiting {timeout} seconds...")
|
||||
if self.event_frame_received.wait(timeout):
|
||||
return
|
||||
|
|
|
@ -111,7 +111,7 @@ class TestARQSession(unittest.TestCase):
|
|||
|
||||
def testARQSessionLargePayload(self):
|
||||
# set Packet Error Rate (PER) / frame loss probability
|
||||
self.loss_probability = 10
|
||||
self.loss_probability = 50
|
||||
|
||||
self.establishChannels()
|
||||
params = {
|
||||
|
|
Loading…
Reference in New Issue