Explorar el Código

Fix renew SecureChannel with background subscriptions

Julius Pfrommer hace 7 años
padre
commit
f937299597
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/client/ua_client_connect.c

+ 5 - 0
src/client/ua_client_connect.c

@@ -222,6 +222,11 @@ openSecureChannel(UA_Client *client, UA_Boolean renew) {
 
     UA_LOG_DEBUG(client->config.logger, UA_LOGCATEGORY_SECURECHANNEL, "OPN message sent");
 
+    /* Increase nextChannelRenewal to avoid that we re-start renewal when
+     * publish responses are received before the OPN response arrives. */
+    client->nextChannelRenewal = UA_DateTime_nowMonotonic() +
+        (2 * ((UA_DateTime)client->config.timeout * UA_DATETIME_MSEC));
+
     /* Receive / decrypt / decode the OPN response. Process async services in
      * the background until the OPN response arrives. */
     UA_OpenSecureChannelResponse response;