Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
How lifetimecount works for long communication breaks?
March 6, 2024
13:23, EET
Avatar
amj005
Member
Members
Forum Posts: 33
Member Since:
July 27, 2021
sp_UserOfflineSmall Offline

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.

March 6, 2024
14:11, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

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?

March 11, 2024
9:16, EET
Avatar
amj005
Member
Members
Forum Posts: 33
Member Since:
July 27, 2021
sp_UserOfflineSmall Offline

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.

March 11, 2024
11:36, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1