Opu.Ua.Client - C# - OPC UA - How can a client recover a session (permanent/durable) with subscription(s)?

147 Views Asked by At

I'm new to OPC UA.
I've installed a Server OPC for sumulation (Integration Objects\OPC UA Server Simulator).
I'm using c# with Opc Foundation std library.
I've successfully implemented the client following https://stackoverflow.com/a/59179379/4745606
So, I have implemented subscription with
subscription.FastDataChangeCallback = OnDataChange;
Everything works..
But when I kill the client I see that on the server the session remain and also the subscriprion remain (for more time than the session).
When I restart the client a new session is created with a new subsciption..

So, how can I recover the previous session?
I unsucessefully tried Session.Recreate() but a session is required as a parameter and documentation is not so good.
All the messages missed while the client was offline, will be recovered in that way? Or I have to set durable/persistent session/subscription somewhere?

0

There are 0 best solutions below