It looks like my connection status callback is called with a session ID that I deleted with UaClient_Session_Delete().
How can I avoid this? Alternatively, is there a way to validate a session ID?
Connection status callback on a deleted session ID
Moderator: uasdkc
-
- Full Member
- Posts: 5
- Joined: 14 Sep 2017, 08:35
-
- Full Member
- Posts: 5
- Joined: 14 Sep 2017, 08:35
Re: Connection status callback on a deleted session ID
Ok, I found a way to avoid deleting the session.
- Support Team
- Hero Member
- Posts: 3078
- Joined: 18 Mar 2011, 15:09
Re: Connection status callback on a deleted session ID
Hello jfsi,
when calling UaClient_Session_Delete(), you need to check the returned status code to see if it actually worked. If the session is not disconnected, the delete call will fail, as there still might come callbacks for the session. Only if you get the ConnectionStatusChanged_CB with UaClient_ConnectionStatus_Disconnected, you can be sure that there will be no more callbacks and the session can be deleted.
when calling UaClient_Session_Delete(), you need to check the returned status code to see if it actually worked. If the session is not disconnected, the delete call will fail, as there still might come callbacks for the session. Only if you get the ConnectionStatusChanged_CB with UaClient_ConnectionStatus_Disconnected, you can be sure that there will be no more callbacks and the session can be deleted.
Best regards
Unified Automation Support Team
Unified Automation Support Team