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: 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: 1021
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: 1021
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:
39 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: 733

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1516

Posts: 6418

Newest Members:

doyleweddle42, berdeadoZet, gidgertrude, LarryWak, onaketner782740, ChenYK, besskeldie0, liamkarpinski7, deannaranieri50, WillieDus

Moderators: Jouni Aro: 1021, Pyry: 1, Petri: 0, Bjarne Boström: 1021, Jimmy Ni: 26, Matti Siponen: 342, Lusetti: 0

Administrators: admin: 1