CoapClient

- Added new `onNoNewMessages()`
- Removed `watch()`
This commit is contained in:
Tristan B. Velloza Kildaire 2023-09-22 16:40:12 +02:00
parent f25066900a
commit e98eb83bad

View File

@ -236,20 +236,19 @@ public class CoapClient
// private Duration sweepInterval; // private Duration sweepInterval;
private Duration retransmitTimeout; private Duration retransmitTimeout;
private void watch()
{
while(true)
{
// TODO: Sleep on a
/** /**
* Acquire the requests lock so we * The intention of this method is that
* can sleep on the condition * some kind-of `CoapMessagingLayer`
* (temporarily unlock mutex) * can call this when it has no new
* messages to process.
*
* This then let's the client handle
* the checking of potentially timed
* out requests, and the re-issueing
* of them to the messaging layer.
*/ */
// requestsLock.lock(); package void onNoNewMessages()
// watcherSignal.wait(); {
requestsLock.lock(); requestsLock.lock();
foreach(CoapRequest curReq; outgoingRequests) foreach(CoapRequest curReq; outgoingRequests)
{ {
@ -259,9 +258,6 @@ public class CoapClient
} }
} }
requestsLock.unlock(); requestsLock.unlock();
Thread.sleep(retransmitTimeout);
}
} }
} }