Persist a session across client reboots using .NET Standard|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Persist a session across client reboots using .NET Standard
Avatar
David Guidali
New Member
Members
Forum Posts: 2
Member Since:
09/28/2022
sp_UserOfflineSmall Offline
1
10/28/2022 - 00:47
sp_Permalink sp_Print

Hi there
I am using an OPC UA client written in .NET Standard, running inside a docker container. The session has a rather high keep-alive time (10 minutes) on the server. Therefore after restarting the container, I want to be able to use the same session which I've already been using before. I can't use a new session and transfer subscriptions, because the TransferSubscription service is not supported by the server.

Is there an example on how to do this via the .NET Standard SDK? Whats a good starting point? Would it be possible to just serialize the session object, save it to disk, deserialize it after module restart and use it to reconnect again? Or is there any specific functionality of the SDK which supports this out of the box? Unfortunately I wasn't able to find anything in the examples.

ThanksCool

Avatar
Randy Armstrong
Admin
Forum Posts: 1450
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
10/28/2022 - 13:59
sp_Permalink sp_Print sp_EditHistory

In theory, you can recover a session after reboot with the authentication token/session id. However, the APIs may not provide a way for the application to supply an authentication token.

Avatar
David Guidali
New Member
Members
Forum Posts: 2
Member Since:
09/28/2022
sp_UserOfflineSmall Offline
3
10/29/2022 - 04:07
sp_Permalink sp_Print

Randy Armstrong said
In theory, you can recover a session after reboot with the authentication token/session id. However, the APIs may not provide a way for the application to supply an authentication token.

  

Yes, due to the specs it should be possible to create a new secure channel and activate the session by using the same credentials like when the session has been created. I'm just not sure if and how its possible by using the C# SDK, since its a little bit hard to understand the SDKs code for me.

Basically all I want is to get the missed alarms / notification messages after rebooting the client. My server can hold longer sessions, but can't transfer subscriptions to a new session. 

Avatar
Randy Armstrong
Admin
Forum Posts: 1450
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
10/30/2022 - 02:43
sp_Permalink sp_Print

My server can hold longer sessions, but can't transfer subscriptions to a new session.

Transfer subscriptions is a mandatory requirement. The server should be updated. Your problems illustrate why.

You could modify the client SDK code save the authentication token and recover after restart.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 27
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1348
Posts: 4575