Page 1 of 1

Bug: client stops sending enquire_link after an EnquireLink timeout when the peer keeps sending PDUs

Posted: Fri Jun 26, 2026 6:39 am
by ggsa
Hi,

We found a bug in SmppClient (version 2.9.35) where the keep-alive loop stops working.

What happens

In SmppClientBase.OnTestLink, the next enquire_link is scheduled by calling session.RunOnTimeout(EnquireLinkInterval, OnTestLink). Most branches do this, but one branch does not.

When our enquire_link gets SMPPCLIENT_RCVTIMEOUT, and the peer has recently sent another PDU (lastRequest < ResponseTimeout), the code keeps the connection open and returns - but it does not schedule the next enquire_link. After this happens once, the client never sends enquire_link again on that session.

Why it is a problem

The connection looks healthy but is no longer probed. If the peer later goes fully silent, the client does not detect it, so the session is never closed or recovered. It becomes a "zombie" session.

Suggested fix

Add the reschedule call before the return:

Code: Select all

  if (res.Header.Status == CommandStatus.SMPPCLIENT_RCVTIMEOUT)
  {
      TimeSpan lastRequest = DateTime.Now - session.LastReset;
      if (lastRequest < session.ResponseTimeout)
      {
          session.RunOnTimeout(EnquireLinkInterval, OnTestLink).Forget(); // <-- was 
  missing
          return;
      }
  }
With this line, the keep-alive loop continues as expected.

Could you please check this and include the fix in a future release?

Thanks.