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
Most reliable way to monitor the connection status with minimal latency
June 5, 2024
15:18, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 138
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: 986
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: 1015
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: 518

Currently Online:
25 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 138

pramanj: 86

rocket science: 81

Francesco Zambon: 81

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 713

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1476

Posts: 6294

Newest Members:

mariam6210, donblanchard632, HowardLon, delilahhuggard, salvadorcolby69, HelenImpar, MnoioDat, babuinsobaka, Miikka Mikkonen, rickeylipinski

Moderators: Jouni Aro: 1015, Pyry: 1, Petri: 0, Bjarne Boström: 986, Jimmy Ni: 26, Matti Siponen: 328, Lusetti: 0

Administrators: admin: 1