Skip to content

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

Closed

Description

@AndreDrubig

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>

Activity

  1. mregen commented on Nov 28, 2024

    @mregen
    Contributor

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

  2. OPCLabs commented on Nov 28, 2024

    @OPCLabs

    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.

  3. self-assigned this
    on Nov 28, 2024
  4. AndreDrubig commented on Dec 3, 2024

    @AndreDrubig
    Author

    @mregen Will you than still adjust the comment according to the new functionality?

  5. added
    bug
    and removed on Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions