Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_TopicIcon
Most reliable way to monitor the connection status with minimal latency
June 5, 2024
15:18, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 144
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Hi,

the following may be a trivial question and I may possibly have overlooked the obvious solution…

I would like to reliably monitor the connection status of an SDK based OPC UA client to a server.
– the isConnected() can be used to check the connection status from time to time
– the ServerStatus (via ServerStatusListener)
– the ServerState (via ServerStatusListener)

The main use case it the detection of network related communication problems and a low latency information of the user, without waiting for network timeouts or SDK session reconnects.

Thanks for your support

June 5, 2024
16:38, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1045
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Good Question.

Basically those 3 are the intended ways, but basically they will only fail once the ServerStatus read fails (if nothing else). Due to some historical stuff e.g. separate stacksdk layers and the need to support multiple connection protocols (even though in my personal opinion opc.https basically should never be used) that is the only reliable way. We are aware that this could use some improvements.

June 12, 2024
15:54, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1029
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, the ServerStatusListener is the best way to get informed of connection breaks. The client sends a read request to ServerStatus every StatusCheckInterval and that times out after StatusCheckTimeout. If you need faster reaction, you can reduce that timeout from the default 10 seconds, but that may create more false alerts. And the client will also start an automatic reconnection whenever the status read fails (or times out).

onServerState is called only when the state changes (from Running to CommunicationFault, for example).
onServerStatus is called after every read, since it contains CurrentTime which should be constantly changing in the server.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 41
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 90
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 732
Moderators: 8
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1545
Posts: 6515
Newest Members:
mood edibles, LouieWreve, daniellabdx, janessan21, sammiebeak359, gena7127517, thorstenbouldin, Brett.Rollason, steven014223542, Roberthat
Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 1, Bjarne Boström: 1045, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0, Elias: 0
Administrators: admin: 1