Subject | Re: [firebird-support] timeout a pending connection via a bad network? |
---|---|
Author | Helen Borrie |
Post date | 2005-12-17T01:30:14Z |
At 09:41 PM 16/12/2005 +0100, you wrote:
developing in Delphi.
It's your application's responsibility to verify that the network
connection is available. This isn't a Delphi list, so we're off-topic here
(but it's Saturday, and I'm the witich!) There are 101 ways to do this in
Delphi, with or without raw sockets. Just google delphi ping and they will
pour forth....Make this what your application does before it even attempts
to connect. Write a function that pings the server and sets a Boolean
property according to the ping response, e.g. NetworkAvailable, and test
this property in BeforeConnect:
procedure TForm1.cnBeforeConnect(Sender: TIB_Connection);
begin
if not NetworkAvailable then
begin
Showmessage('The network is not available.');
Abort;
end
else
// execute your normal connection stuff
end;
If you want to put a retry timer on it, that's a piece of cake,
too. Again, Google it; or just use the built-in timer in IBO's TIB_Session.
./heLen
>Hi,Well, since you first posted this in a Delphi list, I assume you're
>
>Nobody? All applications freeze when networkthroughput drops down to
>allmost zero or even stops at all?
>
>My case was a network (via internet) from which a ping returned about 5%
>of the packets... not to mention the turnaroundtime. Really bad
>performance. As I learned here that FB is rather "chatty" over the
>network, I can understand that in these circumstances it looks like the
>application locks up.
>
>I would like to signal the user that network is bad, and that it might
>be a good idea to try later... How would I do that?
developing in Delphi.
It's your application's responsibility to verify that the network
connection is available. This isn't a Delphi list, so we're off-topic here
(but it's Saturday, and I'm the witich!) There are 101 ways to do this in
Delphi, with or without raw sockets. Just google delphi ping and they will
pour forth....Make this what your application does before it even attempts
to connect. Write a function that pings the server and sets a Boolean
property according to the ping response, e.g. NetworkAvailable, and test
this property in BeforeConnect:
procedure TForm1.cnBeforeConnect(Sender: TIB_Connection);
begin
if not NetworkAvailable then
begin
Showmessage('The network is not available.');
Abort;
end
else
// execute your normal connection stuff
end;
If you want to put a retry timer on it, that's a piece of cake,
too. Again, Google it; or just use the built-in timer in IBO's TIB_Session.
./heLen