From d659c2348bdcabbef399938dab0dc0fbb7c3a5b5 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Fri, 22 Sep 2023 19:06:06 +0200 Subject: [PATCH] CoapClient - When `close()` is called we will unblock all active `get()` calls to futures --- source/doap/client/client.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/doap/client/client.d b/source/doap/client/client.d index 3e83367..a38ffe7 100644 --- a/source/doap/client/client.d +++ b/source/doap/client/client.d @@ -111,8 +111,13 @@ public class CoapClient // Shutdown the messaging layer this.messaging.close(); - // TODO: We must wake up other sleeprs with an error - // (somehow, pass it in, flag set) + // Cancel all active request futures + this.requestsLock.lock(); + foreach(CoapRequest curReq; outgoingRequests) + { + curReq.future.cancel(); + } + this.requestsLock.unlock(); } /**