diff --git a/source/doap/client/client.d b/source/doap/client/client.d index c016378..d94f26a 100644 --- a/source/doap/client/client.d +++ b/source/doap/client/client.d @@ -74,6 +74,22 @@ public class CoapClient init(); } + package ulong newMid() + { + ulong newValue; + + // Lock rolling counter + this.rollingLock.lock(); + + newValue = this.rollingMid; + this.rollingMid++; + + // Unlock rolling counter + this.rollingLock.unlock(); + + return newValue; + } + /** * Constructs a new CoAP client to the * provided endpoint address and port.