[asterisk-users] MySQL() timeout

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Oct 31 08:07:15 CDT 2007


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



More information about the asterisk-users mailing list