Comments (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)
- Update sample to the release version for machine tools
- Event Subscription Problem HOT 1
- Read Nodes with Path HOT 1
- Connecting to remote classic OPC DA server HOT 1
- OpcApplicationConfiguration.LoadClientConfig does not work
- AE.Server EventNotifier and source hierarchy
- OPC-UA Multiclient on same pc HOT 3
- Client Not Connecting with Mode Encrpyt and Sign And Algorithm is SHa256Basic HOT 3
- Event Subscription not working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opcuanet-samples.