Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeepAliveStopped m_keepAliveInterval factor has been removed in Session.cs #2859

Open
AndreDrubig opened this issue Nov 25, 2024 · 2 comments
Assignees

Comments

@AndreDrubig
Copy link

AndreDrubig commented Nov 25, 2024

https://github.com/OPCFoundation/UA-.NETStandard/blame/3ba3b17237ef5f9364f0fd2ed276abfac266d42c/Libraries/Opc.Ua.Client/Session.cs#L754

Commit a1c2216

In 'KeepAliveStopped' the
keep alive time out has been change from return (m_keepAliveInterval * 2) * TimeSpan.TicksPerMillisecond <= delta;
to return (m_keepAliveInterval + kKeepAliveGuardBand) <= delta.TotalMilliseconds;

The factor '2' is missing in the new version. My Client application checks the 'KeepAliveStopped' function (getter) and detect the Keep alive has stopped only because my response is slightly longer than 6 seconds (default alive timer 5 sec + Guard band 1 sec). Before the value would be 5 sec * 2 = 1= sec. Why has this factor been removed? And replace with a constant of only 1 sec (private const int kKeepAliveGuardBand = 1000;) ?

The comment for this has also not been adjusted:
/// <summary> /// Returns true if the session is not receiving keep alives. /// </summary> /// <remarks> /// Set to true if the server does not respond for 2 times the KeepAliveInterval. /// Set to false is communication recovers. /// </remarks>

@mregen
Copy link
Contributor

mregen commented Nov 28, 2024

@AndreDrubig the factor has been removed to improve the response time for the session reconnect handler.

@OPCLabs
Copy link

OPCLabs commented Nov 28, 2024

I have not yet encountered problems due to this change, but from looking at it, I find it risky. As a minimum, I would prefer to see settable properties for the factor and for the offset, so that they can be changed programmatically.

@mregen mregen self-assigned this Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants