🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1751

Re: Uploading content of a folder - read timeout error - source code required...

#1751
From: Remy Lebeau (TeamB)
Date: Fri, 23 Jul 2004 03:43
64 lines
3472 bytes
"Nicolae Fieraru" <nospam@please.cxm> wrote in message
news:41004ff4$1@newsgroups.borland.com...

> once the packet arrives at the server

I assume that by "packet", you are referring to the file as a whole?  The
word "packet" used in this context can be very confusing when used
improperly, since the word "packet" has its own meaning.

> it should send back an acknowledge message

The FTP server does send back an acknowledgement after the file is received
(or an error occurs), yes.

> Does that arrive on the command connection or on the socket connection?

They are both socket connections.  One is used for commands and the other is
used for data.  You should refer to them as "commands connections" and "data
connection", or "commands channel" and "data channel", etc.

As for which connection the acknowledgement comes it, it is the commands
connection.  The data connection is always one-way, in the direction the
data is transferring.

> I use my router with NAT (router always connected as
> a gateway) and if I don't use passive mode, the traffic
> socket won't establish. In active mode, I can connect
> the IdFTP, but I can't put any files there.

Your router needs to be configured to use port forwarding in order to make
active transfers work.  It still won't work, though, because TIdFTP would
have to provide the router's IP as the address the FTP server connects to -
something TIdFTP does not currently support.

> How can I catch read timeout errors?

You already know the answer to that - use a try...catch block.

> catch(...)

"..." does not work very well with VCL exceptions.  You should catch them
directly:

    catch(const Exception &)

> and I want to catch only read timeout errors.

Why only read timeout errors?

> I suppose that when I get such an error, I have to disconnect
> and to reconnect the IdFTP, because otherwise (although IdFTP
> is connected) it will never manage to send the file.

Not necessarily.  A read timeout can occur for any number of reasons, not
all of them harmful to the transfer.

In any case, Indy uses infinite timeouts by default, so there would be no
read timeout error.  That would only occur if you had set the ReadTimeout
property to a non-zero value.  In which case, EIdReadTimeout is the
exception that is thrown.


Gambit
Technical Details
Message-ID: <4100892e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <40f53800@newsgroups.borland.com> <40f566bf$1@newsgroups.borland.com> <40f61327@newsgroups.borland.com> <40f62c94$1@newsgroups.borland.com> <40f681db$1@newsgroups.borland.com> <40f6cad0$1@newsgroups.borland.com> <41004ff4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,f0221a83e98ee596
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <40f53800@newsgroups.borland.com> <40f566bf$1@newsgroups.borland.com> <40f61327@newsgroups.borland.com> <40f62c94$1@newsgroups.borland.com> <40f681db$1@newsgroups.borland.com> <40f6cad0$1@newsgroups.borland.com> <41004ff4$1@newsgroups.borland.com>
Subject: Re: Uploading content of a folder - read timeout error - source code required...
Date: Thu, 22 Jul 2004 20:43:43 -0700
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4100892e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090554158 68.69.17.41 (22 Jul 2004 20:42:38 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail