I will try to explain the situation I am facing, hoping someone will give me a hint.
I have a client (open62541) which connects to a server (Unified Automation), using "UA_Client_connectUsername()" function.
Periodically, the client reads values from some nodes and does some further processing. In general, everything works as expected, but if set the execution period to 1 second, after some iterations, I get BadSecurityChecksFailed and the secure channel closes while the session goes from Activated to Created.
I modified my program, so when secure channel closes, it tries to reconnect using the same "UA_Client_connectUsername()" function., which should connect if not connected, or report that it is already connected otherwise.
The problem is that it doesn't reconnect. I get a warning that the client is already connected, though the status is secureChannel:Closed and session:Created.
My basic question is, how does open62541 handle sessions and connections? It is not clear in the documentation.
In addition, how can my client reconnect to an already open session creating a new channel? Isn't that handled by "UA_Client_connectUsername()" function?
Any hint to the right direction, will be highly appreciated.
Thank you in advance!