Aaron Looks good, however I'd potentially make it more configurable so that the X x wait is one of the default settings and can be configured should it need be.
For example if (cfg_get_integer(&enquire_link_interval, grp, octstr_imm("enquire-link-retry")) == -1) enquire_link_interval = SMPP_ENQUIRE_LINK_RETRY; <other bits of code needed to map the parameter to the smpp structure> if(date_universal_now() - smpp->last_enquire_received > (smpp->enquire_link_retry * smpp->enquire_link_interval)) { etc. Also - would it make sense to send an extra send_enquire_link to make sure that the other end is not contacting? Cheers Alex ----- Original Message ----- From: "Aaron Brady" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 08, 2003 6:04 AM Subject: Patch: To add timeouts to SMPP connections > Hi, > > I've just joined the list, primarily to send the following trivial patch. > > The patch is available at: > > http://insom.me.uk/hacks/kannel-timeouts.diff > > with a write up at: > > http://insom.me.uk/hacks/kannel-timeouts.html > > Copied here for completeness: > > --- > kannel-timeouts.diff implements a timeout for SMSC connections with Kannel. > > SMPP contains primitives called link_enquire & link_enquire_resp, which are > used to make sure that both ends of an SMPP are both live. After a period of > time, if no response is received for an enquiry then the connection should > be broken and reconnection attempted. > > Kannel 1.2.1 (Stable) doesn't ship with this facility, and if the network > between hosts goes down (for example, an IPsec VPN timing out) Kannel may > wait until the socket closes from ECONNRESET, which can be a long time > indeed. > > By default, this patch waits until three enquiries go unanswered before > closing the connection and setting the flag SMSCCONN_RECONNECTING to make it > reconnect. > > Work on tracking down this problem and fixing it was sponsored by BongTree > Mobile > > --- > > > > Best regards, > > > > Aaron Brady, > > Crestsource Limited - http://www.crestsource.com >