0

I have written a library which connects to an opc server and creates subscriptions to get notified about data changes. There is also an event which get fired when the opc server is going to shutdown. I am using the OPC .NET API and C#.

How can I handle a connection abort due to a network failure (server crashes, cable gets unplugged)?

j0k
  • 22,600
  • 28
  • 79
  • 90
Bastian
  • 31
  • 2
  • 4

1 Answers1

0

There is no precise way to do this, there are some techniques to mitigate the issues like having a heartbeat monitor that checks the status of the OPC server, this can be done in various ways from checking the actual server status or check some counter on the server.

You also need to check if your subscriptions are still active since the are of type Observer pattern you may not know whether something went wrong and the subscriptions stop working. This can be done by measuring the time since last fired data change event but it depends a bit on traffic that you expect.

AndersK
  • 35,813
  • 6
  • 60
  • 86