SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

Systemlink Python Framework (nisystemlink-clients-python) Error Recovery

I have a systemlink Python application running and working that is essentially the following simplified code (error checks were removed for simplicity):

 

httpCfg = HttpConfiguration(server_uri="http://localhost:9090", username="admin", password="test")
mgr = TagManager(httpCfg)
with ExitStack() as stack:
     paths = ["tags*"]
     selection = stack.enter_context(mgr.open_selection(paths))
     subscriptionstack.enter_context(selection.create_subscription(update_interval=timedelta(milliseconds=250)))
     subscription.tag_changed += on_tag_changed
     try:
          while True:
          sleep(1)
     except KeyboardInterrupt:
          pass
My question is, how can a loss of socket communication be detected (e.g. if the Ethernet cable is removed), in order to reinitialize from the HttpConfiguration (I assume that's where the reinitialization would have to occur)?
0 Kudos
Message 1 of 1
(1,112 Views)