Browse Source

Bugfix: delete subscriptions that are closed by the server

If the OPC-UA server has closed the session without the client knowing, the
subscription should be deleted.
Wolfgang Braun 6 years ago
parent
commit
9f0f1a7411
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/client/ua_client_subscriptions.c

+ 3 - 0
src/client/ua_client_subscriptions.c

@@ -619,6 +619,9 @@ UA_Client_Subscriptions_processPublishResponse(UA_Client *client, UA_PublishRequ
             UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT,
                            "Received Publish Response with code %s",
                             UA_StatusCode_name(response->responseHeader.serviceResult));
+            UA_Client_Subscription* sub = findSubscription(client, response->subscriptionId);
+            if (sub != NULL)
+              UA_Client_Subscription_deleteInternal(client, sub);
         }
         return;
     }