Wednesday, October 31, 2007

Re: [asterisk-users] MySQL() timeout

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@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

No comments: