Skip to content
Snippets Groups Projects
Commit 0a4560be authored by Thomas Juerges's avatar Thomas Juerges
Browse files

Ping server only if the connection is active.

parent 234cc476
No related branches found
No related tags found
1 merge request!12Adjustments and fixes for attribute_wrapper merge
......@@ -97,7 +97,10 @@ class OPCUAConnection(CommClient):
ping the client to make sure the connection with the client is still functional.
"""
try:
self.client.send_hello()
if self.connected is True:
self.client.send_hello()
else:
self.streams.debug_stream("Will not ping OPC-UA server {} because the connection is inactive.".format(self._servername()))
except Exception as e:
raise Exception("Lost connection to server {}.".format(self._servername())) from e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment