Quellcode durchsuchen

Fixed UA_Client_disconnect()

If the client runs into an error state, we can't reconnect.
As all states, but UA_CLIENTSTATE_READY are connected, we should be able to disconnect (which is necessary to renew the connection - as required by the error client states).
Root-Core vor 8 Jahren
Ursprung
Commit
b8117c9323
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      src/client/ua_client.c

+ 1 - 1
src/client/ua_client.c

@@ -665,7 +665,7 @@ UA_Client_connect(UA_Client *client, const char *endpointUrl) {
 }
 
 UA_StatusCode UA_Client_disconnect(UA_Client *client) {
-    if(client->state != UA_CLIENTSTATE_CONNECTED)
+    if(client->state == UA_CLIENTSTATE_READY)
         return UA_STATUSCODE_BADNOTCONNECTED;
     UA_StatusCode retval = UA_STATUSCODE_GOOD;
     /* Is a session established? */