Board index » delphi » Indy Freezes when Internet connection is down...????

Indy Freezes when Internet connection is down...????


2003-10-14 03:29:10 PM
delphi83
Hello,
We are trying to develop a tool which is a server application.This
application is used to pop mails from the mail server accounts and post them
to newsgroups so that everybody has access to those mails..Mainly used for
support queries.
The mail server is outside the LAN and News Server is in LAN. When we try
to run this application on one of the servers(which does not have a gateway)
on this LAN...and further when the IP address of the gateway(i.e. gateway on
the server which connects the LAN and WAN) is released i.e. in simple terms
when the internet connection is disabled while poping mails from the mail
server .....the application freezes.This application uses Indy version
9.14....We have also used TidAntiFreeze so that the user interface does not
freeze while retrieving the mails...
Can anybody please suggest on the possible solutions for this problem...
Thanks in advance:)
 
 

Re:Indy Freezes when Internet connection is down...????

"smita" <XXXX@XXXXX.COM>writes
Quote
in simple terms when the internet connection is
disabled while poping mails from the mail server .....
the application freezes.
Indy is a blocking library. It sounds like you are using the Indy
components in the context of the main VCL thread, thus the Indy operations
will block the main VCL thread during their operations. TIdAntiFreeze is a
hack at best, not a reliable solution all the time. You would be better off
doing all of your Indy connection work in a separate thread, then the main
VCL thread won't be blocked anymore.
Gambit
 

Re:Indy Freezes when Internet connection is down...????

Thank You so much for the quick response but the problem is that indy fails
to recognize that the connection has been disabled and thus the application
does not terminate gracefully..
We need a way to handle this problem such that the current message retireval
should be terminated and appropriate message should be displayed...
So even having a seperate thread may not solve this problem because indy
itself does not recognize the connection getting disabled.
Any more suggestions...please......
Thanks
sim.
 

Re:Indy Freezes when Internet connection is down...????

simran writes:
Quote
Thank You so much for the quick response but the problem is that indy
fails to recognize that the connection has been disabled and thus the
application does not terminate gracefully..
We need a way to handle this problem such that the current message
retireval should be terminated and appropriate message should be
displayed... So even having a seperate thread may not solve this
problem because indy itself does not recognize the connection getting
disabled. Any more suggestions...please......
Thanks
sim.
this may happen when
1. you are not trying to read or write to the socket
2. you are only listening and the connection was dropped by
network conditions, so that TCP does not know that it
has lost the network connection
Grahame
 

Re:Indy Freezes when Internet connection is down...????

Thanks a lot for your response...but we have found a solution which seems to
have solved the problem...After connecting to the mail server we are using a
ReadTimeout of 4 seconds....which gets triggered once the connection is
disabled and it fails to read after trying for 4 seconds...
We have tested it and now it terminates gracefully giving an error message
of ReadTimeOut.
Once Again thanks for ur help....
Sim.
"Grahame Grieve" <XXXX@XXXXX.COM>writes
Quote
simran writes:

>Thank You so much for the quick response but the problem is that indy
>fails to recognize that the connection has been disabled and thus the
>application does not terminate gracefully..
>We need a way to handle this problem such that the current message
>retireval should be terminated and appropriate message should be
>displayed... So even having a seperate thread may not solve this
>problem because indy itself does not recognize the connection getting
>disabled. Any more suggestions...please......
>Thanks
>sim.

this may happen when

1. you are not trying to read or write to the socket

2. you are only listening and the connection was dropped by
network conditions, so that TCP does not know that it
has lost the network connection

Grahame