@@ -306,7 +306,7 @@ receiveServiceResponse(UA_Client *client, void *response, const UA_DataType *res
if(retval != UA_STATUSCODE_GOOD && retval != UA_STATUSCODE_GOODNONCRITICALTIMEOUT) {
if(retval == UA_STATUSCODE_BADCONNECTIONCLOSED)
- client->state = UA_CLIENTSTATE_DISCONNECTED;
+ setClientState(client, UA_CLIENTSTATE_DISCONNECTED);
UA_Client_close(client);
break;
}
@@ -22,7 +22,7 @@
/********************/
/* Set client state */
-static void
+void
setClientState(UA_Client *client, UA_ClientState state)
{
if(client->state != state) {
@@ -118,6 +118,9 @@ struct UA_Client {
#endif
};
+setClientState(UA_Client *client, UA_ClientState state);
+
UA_StatusCode
UA_Client_connectInternal(UA_Client *client, const char *endpointUrl,
UA_Boolean endpointsHandshake, UA_Boolean createNewSession);