Re: IdFtp9->Connect() hangs

Giganews Newsgroups
Subject: Re: IdFtp9->Connect() hangs
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Thu, 8 Jun 2006

"poojo hackma" <poojo.com/mail> wrote in message
news:8BF875129EFBE240poojo.com/mail...

> I have set a 2 second timeout, but this does not seem
> to effect the Connect() method.

You are setting the ReadTimeout property.  That has no effect on
establishing a connection, only on reading data from a connection that is
already established.  You need to use the ATImeout parameter of Connect()
instead, ie:

    mFtp->Connect(true, 2000);

>      if (mFtp->Connected() == false)

There is no need to do that.  Connect() throws an exception if it fails.

>    catch (const EIdSilentException &eId)

Why are you catching EIdSilentException generically instead of
EIdConnClosedGracefully specifically?

Gambit

Replies

In response to

IdFtp9->Connect() hangs posted by poojo hackma on Thu, 8 Jun 2006