From 4aaa785e84fce120a9002f070809c52f40b523c6 Mon Sep 17 00:00:00 2001 From: Michiel De Witte Date: Wed, 12 Dec 2018 12:03:44 +0100 Subject: [PATCH] Changed send_request in helperclient to check response on message id --- coapthon/client/helperclient.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/coapthon/client/helperclient.py b/coapthon/client/helperclient.py index 7308473..4ec0aad 100644 --- a/coapthon/client/helperclient.py +++ b/coapthon/client/helperclient.py @@ -234,7 +234,13 @@ class HelperClient(object): if no_response: return try: - response = self.queue.get(block=True, timeout=timeout) + while True: + response = self.queue.get(block=True, timeout=timeout) + if response is not None: + if response.mid == request.mid: + return response + else: + return response except Empty: #if timeout is set response = None