瀏覽代碼

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 年之前
父節點
當前提交
c56da680ae
共有 1 個文件被更改,包括 4 次插入2 次删除
  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;
     }