Hello,
I am currently working on a client for a school project that needs to fail
over to a secondary server if the primary server fails or is down.
The projects requires a short failover time, since my teammates and I want
it to be transparent to the user.
I have looked at the MySQL++ source code and changed the call to the
Connection() constructor to include a connect_timeout value. I am under the
impression that this value determines how long MySQL++ waits for an initial
reply from the host it is trying to connect to. Regardless of which value I
put into this function, it appears that the exception is thrown ~20 seconds
after I call the constructor.
I have searched google to find someone with a similar problem, but it
appears that I am the only one who has this. I downloaded a sourceforge
project (MySQL-Navigator) that connects to a MySQL-DB and it has the option
to let me specify a 'timeout'. Once again, giving it two drastically
different values (99 and 2), I still get a timeout after ~20 seconds, when
I enter an IP that is not in use on our lan.
I was wondering if someone has ever gotten a different timeout length to
work and/ or if I am looking at the right place (I tried manually setting
the mysql_options(&mysql ,MYSQL_OPT_CONNECT_TIMEOUT, (char *)&mytoVal) to
no avail.
Any/ all help would be greatly appreciated,
Greg
| Thread |
|---|
| • Changing the inital Connect() timeout | Gregor Kronenberger | 12 Mar |