Anyone know if the MySQL() application has a configurable timeout? If it tries to connect to a bogus IP, it's timeout seems to be a few minutes. I'd like to cut it down to a few seconds. Doug. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071030/bf50fd87/attachment.htm
Douglas Garstang wrote:> Anyone know if the MySQL() application has a configurable timeout? > If it tries to connect to a bogus IP, it's timeout seems to be a few > minutes.I never got a response on that question myself. Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
I guess... it shouldn't be too hard to find the time out value in the source and change it.... ----- Original Message ---- From: Doug Lytle <support at drdos.info> To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com> Sent: Tuesday, October 30, 2007 5:23:35 PM Subject: Re: [asterisk-users] MySQL() timeout Douglas Garstang wrote:> Anyone know if the MySQL() application has a configurable timeout? > If it tries to connect to a bogus IP, it's timeout seems to be a few > minutes.I never got a response on that question myself. Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety." _______________________________________________ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071030/c9836d06/attachment.htm
On Tuesday 30 October 2007 18:19:33 Douglas Garstang wrote:> Anyone know if the MySQL() application has a configurable timeout?It does not.> If it tries to connect to a bogus IP, it's timeout seems to be a few > minutes. I'd like to cut it down to a few seconds.The key would be adding this line at the appropriate point: mysql_options(&mysql, MYSQL_OPT_CONNECT_TIMEOUT, &timeout) where timeout is an integer. Remember that it needs to be set BEFORE the connection. -- Tilghman
Tilghman Lesher wrote:> The key would be adding this line at the appropriate point: > mysql_options(&mysql, MYSQL_OPT_CONNECT_TIMEOUT, &timeout) > where timeout is an integer. Remember that it needs to be set > BEFORE the connection. > >Anybody like to give more detailed instructions for those of use not instructed in C? Thanks! Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Find this line: if (mysql_real_connect(mysql, dbhost, dbuser... Add this before that line: int timeout = 10; /* 10 second timeout */ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (const char *) &timeout); And recompile. On 10/31/07, Doug Lytle <support at drdos.info> wrote:> > Tilghman Lesher wrote: > > The key would be adding this line at the appropriate point: > > mysql_options(&mysql, MYSQL_OPT_CONNECT_TIMEOUT, &timeout) > > where timeout is an integer. Remember that it needs to be set > > BEFORE the connection. > > > > > > Anybody like to give more detailed instructions for those of use not > instructed in C? > > Thanks! > > Doug > > > -- > > Ben Franklin quote: > > "Those who would give up Essential Liberty to purchase a little Temporary > Safety, deserve neither Liberty nor Safety." > > > > _______________________________________________ > --Bandwidth and Colocation Provided by http://www.api-digital.com-- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071031/9acbe5a0/attachment.htm
Sean Bright wrote:> Find this line: > > if (mysql_real_connect(mysql, dbhost, dbuser...Excellent! Thank you both! Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."