Browse Source

In response to #417: Notification Seq.No. now start with 1, not 0; Reenabled keepalive-safeguard (non-async keepalive sending instead of 'queueing' the publish is handled in the service).

ichrispa 9 years ago
parent
commit
c56da680ae
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/server/ua_subscription.c

+ 4 - 2
src/server/ua_subscription.c

@@ -12,7 +12,7 @@ UA_Subscription *UA_Subscription_new(UA_Int32 subscriptionID) {
         return UA_NULL;
     new->subscriptionID = subscriptionID;
     new->lastPublished  = 0;
-    new->sequenceNumber = 0;
+    new->sequenceNumber = 1;
     memset(&new->timedUpdateJobGuid, 0, sizeof(UA_Guid));
     new->timedUpdateJob          = UA_NULL;
     new->timedUpdateIsRegistered = UA_FALSE;
@@ -113,7 +113,9 @@ void Subscription_updateNotifications(UA_Subscription *subscription) {
         // Decrement KeepAlive
         subscription->keepAliveCount.currentValue--;
         // +- Generate KeepAlive msg if counter overruns
-        Subscription_generateKeepAlive(subscription);
+        if (subscription->keepAliveCount.currentValue < subscription->keepAliveCount.minValue)
+          Subscription_generateKeepAlive(subscription);
+        
         return;
     }