I posted something similar a while back (see "Link Status Failure"), but it seems I forgot to raise the related case about unexpected link status period behaviour. I'm still getting the same unexpected behaviour with opendnp3 3.1.1.
I've got an outstation with a link status period of 60s, and no events being sent over dnp3. I've turned off link status period on the host. The host isn't doing any polling. So the link is quiet, except for periodic link status requests. However, I'm getting link status requests precisely every 120s (whatever link status period I choose, the actual link status request frequency is double).
I've put some debug in the library to try and isolate the problem. An example sequence is:
LinkContext::OnKeepAliveTimeout(): not elapsed (59) < this->config.KeepAliveTimeout(60)
LinkContext::StartKeepAliveTimer(15531)
LinkContext::OnKeepAliveTimeout()
LinkContext::OnKeepAliveTimeout(): elapsed (119) >= this->config.KeepAliveTimeout(60)
LinkContext::StartKeepAliveTimer(15591)
LinkContext::CompleteKeepAlive()
I can't quite figure out where the fault (if indeed it is a fault) lies. It seems that the timeout expires slightly early, which it correctly realises hasn't actually expired, but then it starts another timeout of 60s duration. A library modification making it restart the timeout with 0.5s duration if it hasn't actually expired 'fixes' the link status period to 60s. However, maybe the root cause is the original timeout expiring slightly early?
Any advice appreciated! I'm happy to fix it once we've established which bit needs fixing.
Nick