13:23, EET
July 27, 2021
Hi,
If we have long communication breaks, can you provide info how the client works and what should be ideal value for the lifetimecount?
Also, what happens if communication break is longer than lifetimecount? Does client execute onLifetimeCount() call? And we can handle by reconnecting subscription again right?
Thanks.
14:11, EET
Moderators
February 11, 2020
Hello,
Dealing with a communication break depends more on its nature than its duration. If there is simply a very long network error that prevents the Client and the Server from exchanging messages, you could use a sufficiently high LifeTimeCount to make sure the Subscription survives the communication break. On the other hand, if the communication break is caused by the Server shutting itself down or crashing, then it doesn’t really matter how high the LifeTimeCount is since recreating the Subscription and its MonitoredItems is required anyway.
The onLifetimeTimeout method of SubscriptionAliveListener interface is called if the Client hasn’t received notifications for longer than its lifetime period, which is the PublishingInterval multiplied by the LifeTimeCount. When the onLifetimeTimeout has been called, you can assume that the Subscription no longer exists on the Server and recreating it is required. However, the automatic reconnect of UaClient will handle recreating Subscriptions when reconnecting to the Server, so you shouldn’t need to recreate it manually.
Are you experiencing a problem with Subscriptions that is not being fixed by the automatic reconnect after the connection break?
9:16, EET
July 27, 2021
Hi,
Thanks for the inputs.
Added to the above, in case if we the server is crashed or restarted, does the SDK take care of re establishing the connections etc, once the server is back?
So, in short if the issue is because of the network or server issue, SDK will re attempt to connect and recreate and making subscriptions work right?
We are not having problem if it is just about the short network error. Usually the SDK will be taking care on the short network issues.
But trying to understand how to set lifetimecount and also how much SDK will handle and how much we should handle, to make our application or client code reliable and self healing.
If SDK is handling most of the things, then we can simply keep very high lifetimecount and add logic to restart if it reaches onLifetimeCount, in worst case, right?
Thanks.
11:36, EET
Moderators
February 11, 2020
Hello,
In most connection breaks, the SDK should automatically handle recreating Subscriptions and MonitoredItems. Therefore, you will just need to make sure the LifeTimeCount has sufficiently high value that a LifetimeTimeout is not triggered due to the Server being slow to respond to Client. Under normal circumstances, Subscriptions should never experience a LifetimeTimeout when connected to a Server, unless the LifeTimeCount is too small.
Most Users Ever Online: 1919
Currently Online:
40 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 726
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_galleryModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1