Does 'connect timeout' option in freetds.conf work?
Brian Bruns
camber at ais.org
Mon Apr 15 15:01:00 EDT 2002
It appears to "almost" work ;-)
The code to handle timeouts is there, and the code to read the timeout
values from the freetds.conf file is there, but the two don't seem to be
hooked up.
You can set timeouts through the API calls though. I'll cook up a
permanant patch tonight, but roughly what needs doing is to modify the
tds_connect() function in login.c, create a integer variable at the top:
int connect_timeout = 0;
then sometime after calling tds_get_config() insert the following (just
ahead of "Jeff's hack" is where i'd put it):
if (config->connect_timeout) {
connect_timeout = config->connect_timeout;
} else if (login->connect_timeout) {
connect_timeout = login->connect_timeout;
}
Then just replace references to "login->connect_timeout" with
"connect_timeout" through the rest of the function.
Cheers,
Brian
> Reading the user guides suggests that an option 'connect timeout' is
> available. Does this function work because the tests I'm doing at the
> moment would suggest it isn't.
> i.e. When trying to connect to a IP address of a server that is not
> available. TDS waits until the linux network stack returns an error code.
>
> I noticed in the source code of the latest TDS snapshot there is code
> relating to the connect timeout option but not sure what exactly it is
> doing.
>
> Is there any changes I need to make before compiling to enable this code?
>
> Any help would be greatly appreciated
> Nick
More information about the FreeTDS
mailing list