Subject Re: [firebird-support] timeout a pending connection via a bad network?
Author John vd Waeter
Helen Borrie wrote:

> Not quite: he said: "I'm not aware of any facility via the API to
> accomplish this.
> This is a Firebird question essentially."

You're right.

> Given that Jason's concern is the API, I suppose he was right, strictly
> speaking, insofar as it wasn't an IBO issue.

I took the freedom to interpret it this way.

> >Somewhere in this chain I think there should be a
> >possibility to monitor the quality of the connection and to ring a bell
> >when quality drops below a certain level.
> There is: it's called ping.

But ping is not in the chain... its a parallel process that can only be
used if serverside answers icmp-packets, which is not always the case...
but that's another discussion.

> And the lib relies on the NOS. The application relies on the application
> developer to cover the bases. The application developer relies on the ISP
> to provide sufficient service and on the site user to configure network
> servers and clients appropriately to that service. It's also the
> application developer's job to warn the site user that trying to use his
> 2-tier system across a telephone network is not covered by the reality
> clause.

In this case its about a broadband cable connection that is used to
read/write some data at regular intervals (abt 10 minutes). Of course I
would not deploy an application without describing minimal demands to
the neccessary resources.


Thank you, however, it can only tell me the responsetime, if any. Now I
can decide, just before starting a connection: 'Ping is taking too long,
better try again later'. But this can only be used to determine wether
to start a connection or not.

Suppose the network is good, I start my ACTION (connect to FB server,
start a transaction, do something, commit or rollback, disconnect).

Just before starting the ACTION, I start a timer in another thread.

I keep monitoring this timerthread and some flag that indicates that
ACTION should have been finished. At a certain time I might find:
'ACTION is taking too long, something obviously went wrong, something
that apparantly does not trigger any errors or timeouts in the NOS, the
sockets, the API, my IBObjects, my application. I want to, I even must

Same thing on explorer, mozilla or whatever browser. It can and will
tell me if a server can be reached, it can tell me if there are errors
in the pages etc etc. But it happens quite frequently that NO errors are
triggered, that a message 'loading data from xxxx' is displayed on the
statusbar and that some animated gif shows me the waiting state of the
browser. But there IS a button to interrupt/abort the process! You don't
need taskmanager to kill the application...

And that is my simple question. How to abort gracefully a bad
connection? Can it be done? If not gracefully, would it be possible and
safe (and how?) to use something like IB_Connection.Forcedisconnect?
Would it be responsive or would it be busy and trapped in its own thread?

(Sorry OT again here)?

Thank you again for your time :-)