Subject RE: [firebird-support] setting a timeout for isc_attach_database?
Author Kevin Heneghan
I bit more info into this problem. I am running 1.0.2 with an additional
patch that went into 1.0.3. I have a simple client program, see below.
When I attach to a device that is firewalled ot non-existent. I get a
380 seconds time dispite the value entered in timeout. Any suggestions?


#include <sys/time.h>
#include <stdio.h>

#include "ibase.h"

float timeDiff(const timeval& start, const timeval& end)
long secs = end.tv_sec - start.tv_sec;
long microSecs;

if (secs < 0)
secs = 0;

if (end.tv_usec > start.tv_usec)
microSecs = (end.tv_usec - start.tv_usec) / 1000;
microSecs = (1000000 - start.tv_usec + end.tv_usec) / 1000;

return ((microSecs / 1000.0) + secs);

isc_db_handle db;
ISC_STATUS isc_status[20];
char dbName[64];
char to_dpb[] = {isc_dpb_version1, isc_dpb_connect_timeout, 30};

// init
db = 0L;
strcpy(dbName, "");

// attach
timeval endTime, startTime;
gettimeofday(&startTime, 0);

isc_attach_database(isc_status, 0, dbName, &db, sizeof(to_dpb),
if(isc_status[0] == 1 && isc_status[1])

gettimeofday(&endTime, 0);
printf("isc_attach_database = %s time to connect = %f seconds \n",
dbName, timeDiff(startTime, endTime));


Unable to complete network request to host "".
-Failed to establish a connection.
-Connection timed out
isc_attach_database =
time to connect = 380.942993 seconds

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Tuesday, January 27, 2004 7:44 PM
Subject: Re: [firebird-support] setting a timeout for

At 06:30 PM 27/01/2004 +0000, you wrote:
>I am using distributed transactions to multiple firebird databases
>located on devices attached to a network. If one of these devices is
>unavailable, isc_attach_databse takes 380.06 seconds to timeout. How
>can I adjust this timeout to something reasonable like 15 seconds.
>adjusting isc_dpb_connect_timeout does not seem to effect the client
>side timeout.
>Any help is appreciated.

Configure ConnectionTimeout (Version 1.5 forward)
connection_timeout (Versions prior to Firebird 1.5)
Number of seconds to wait before abandoning an attempt to connect.
180 (so if you are getting 380 secs then something else in your network
causing a delay as well...)



Yahoo! Groups Links

* To visit your group on the web, go to:

* To unsubscribe from this group, send an email to:

* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <> .


DISCLAIMER: The information contained in this e-mail is confidential and is intended solely for the review of the named addressee, and in conjunction with specific Acopia Networks business. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you are unable to treat this information accordingly, or are not the intended recipient, please notify us immediately by returning the e-mail to the originator.

[Non-text portions of this message have been removed]