Giter Club home page Giter Club logo

Comments (1)

kpreisser avatar kpreisser commented on June 13, 2024 1

Hi @JojoEffect,
thanks for opening this issue!

Your understanding is right that when ReconnectTimeout > 0 and the client loses connection to the server, the Reconnecting event is triggered, and the client automatically tries to establish a new connection to the server.

If the client is able to reconnect to the server, one of the following events will be raised:

  • Reconnected will be raised if the session still exists at the server, and the client was able to reconnect to the existing session.
  • Connected will be raised if the session no longer exists at the server, and the client has automatically created a new session.

In both cases, the client can be used again, and previously created subscriptions should still work. However, there are some differences:

  • When Reconnected is raised, it means for subscriptions that you will get e.g. data changes that occured during the time while the client didn't have a connection to the server, because the session (and therefore the subscription) was still active at the server and collected data.
  • When Connected is raised, the client had to re-create subscriptions on the server, which means e.g. data changes that occured during the time while the client didn't have a connection to the server will be lost (you will only get changes that occured after the client has created a new session).

Additionally, if you called OpcClient.RegisterNode(), then in case of Reconnected the node IDs will still work, but in case of Connected they will probably no longer work and you have to call OpcClient.RegisterNode() again.

In your example, you are restarting the server, so after the client can reconnect, the previous session will no longer exist on the server, which is why in this case Connected is always raised instead of Reconnected.

However, you are right that the documentation is a bit outdated and doesn't describe this difference, as this behavior was introduced with OPC UA .NET SDK version 2.12.0.0. Previously, the Reconnected event was raised in call cases after the Reconnecting event.
We will track this internally to update the documentation, so that it reflects the current behavior.

Thanks!

from opcuanet-samples.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.