--- In [email protected], Thomas Hruska <[EMAIL PROTECTED]> wrote:
>
> ayman el-barbary wrote:
> > Hello every one, I have a problem when i call GetFtpConnection
> > method from CInternetSession class, I call it as follows:
> > 
> > ////////////////////////////////////////////////
> > CInternetSession netSession;
> > CFtpConnection *pFtp;
> > 
> > CString SERVER_IP = "158.10.25.6";
> > int PORT = 5000;
> > 
> > TRY
> > {
> > pFtp = netSession.GetFtpConnection(SERVER_IP,"user","pass",PORT);
> > }
> > CATCH (CInternetException,ex)
> > {
> > char szError[100];
> > memset(szError,0,100);
> > ex->GetErrorMessage(szError,100);
> > AfxMessageBox(szError);
> > }
> > 
> > END_CATCH
> > 
> > ////////////////////////////////////////////////
> > 
> > some times it successfully connected to the FTP server, but
> > at some times it throw an exception told me that "Computer
> > is disconnected from the network" , i don't know why however
> > both the FTP server is on and connected to the network and
> > also the client which contains this code is also on and
> > connected to the network, so from where this error.
> > 
> cURL or another similar library may be a better approach than
> to use the mostly broken embedded FTP client found in IE/
> Explorer.  If the problem is intermittent, then you could
> just throw it in a loop of some sort and that might work too.

Another point is the other side of the FTP link. I know that e.g.
Solaris sometimes needs minutes(!) to release a TCP/IP socket after it
has been closed cleanly. Is your FTP server a Solaris box?

Regards,
Nico

Reply via email to