Hello,
To implement a simple protocol in python, I've used a thread to monitor acknowledgements send by the receiver. To do this, I use a thread in a function
def ackListener(self):
while self.waitingforack:
ack = self.socket_agent.recv(4)
...
exit()
where self.waitingforack
is a boolean I set to False
when I've received an acknowledgement for every messages I've sent.
The problem is that my code is blocking at the self.socket_agent.recv(4)
operation, the modification of the value of waitingforack
is done too late
Is there a way to force the Thread to terminate when I'm not waiting for ack anymore ?
Thank you