FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.08k stars 354 forks source link

check server alive from the server code side #1418

Open ikasakmongkon opened 1 year ago

ikasakmongkon commented 1 year ago

Hi, I am sorry. I am a newbie Is it possible that we can check if the server still alive or crashed or network interface down from the server code side?

Thanks

schroeder- commented 1 year ago

call check_connection which will throw an exception on connection lost.

while True:
     await asyncio.sleep(1)
     await client.check_connection()  # Throws a exception if connection is lost
ikasakmongkon commented 1 year ago

Hi, Is there an attribute of server status or internal the server status that we can check the server status is running or failed

schroeder- commented 1 year ago

No this currently not possible.

AndreasHeine commented 1 year ago

what do you mean with running? tcp socket? processing ua requests?

this is not so easy to do opc ua has a layered architecture...