Subject | RE: [firebird-support] setting a timeout for isc_attach_database? |
---|---|
Author | Kevin Heneghan |
Post date | 2004-01-29T15:02Z |
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?
Kevin
#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;
else
microSecs = (1000000 - start.tv_usec + end.tv_usec) / 1000;
return ((microSecs / 1000.0) + secs);
}
main()
{
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, "10.59.1.18:/my.db");
// attach
timeval endTime, startTime;
gettimeofday(&startTime, 0);
isc_attach_database(isc_status, 0, dbName, &db, sizeof(to_dpb),
to_dpb);
if(isc_status[0] == 1 && isc_status[1])
{
isc_print_status(isc_status);
}
gettimeofday(&endTime, 0);
printf("isc_attach_database = %s time to connect = %f seconds \n",
dbName, timeDiff(startTime, endTime));
}
Output:
/lhome/test/db_timeout/timeout_test/linux/Debug_Build/timeout_test
Unable to complete network request to host "10.59.44.18".
-Failed to establish a connection.
-Connection timed out
isc_attach_database = 10.59.44.18:/my.db
time to connect = 380.942993 seconds
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Tuesday, January 27, 2004 7:44 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] setting a timeout for
isc_attach_database?
At 06:30 PM 27/01/2004 +0000, you wrote:
connection_timeout (Versions prior to Firebird 1.5)
Number of seconds to wait before abandoning an attempt to connect.
Default
180 (so if you are getting 380 secs then something else in your network
is
causing a delay as well...)
/heLen
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe
Service <http://docs.yahoo.com/info/terms/> .
--------------------------------------------------------
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]
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?
Kevin
#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;
else
microSecs = (1000000 - start.tv_usec + end.tv_usec) / 1000;
return ((microSecs / 1000.0) + secs);
}
main()
{
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, "10.59.1.18:/my.db");
// attach
timeval endTime, startTime;
gettimeofday(&startTime, 0);
isc_attach_database(isc_status, 0, dbName, &db, sizeof(to_dpb),
to_dpb);
if(isc_status[0] == 1 && isc_status[1])
{
isc_print_status(isc_status);
}
gettimeofday(&endTime, 0);
printf("isc_attach_database = %s time to connect = %f seconds \n",
dbName, timeDiff(startTime, endTime));
}
Output:
/lhome/test/db_timeout/timeout_test/linux/Debug_Build/timeout_test
Unable to complete network request to host "10.59.44.18".
-Failed to establish a connection.
-Connection timed out
isc_attach_database = 10.59.44.18:/my.db
time to connect = 380.942993 seconds
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Tuesday, January 27, 2004 7:44 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] setting a timeout for
isc_attach_database?
At 06:30 PM 27/01/2004 +0000, you wrote:
>I am using distributed transactions to multiple firebird databasesConfigure ConnectionTimeout (Version 1.5 forward)
>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.
connection_timeout (Versions prior to Firebird 1.5)
Number of seconds to wait before abandoning an attempt to connect.
Default
180 (so if you are getting 380 secs then something else in your network
is
causing a delay as well...)
/heLen
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe
>* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
--------------------------------------------------------
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]