🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1840

TidFTP: Timeout and error translation?

#1840
From: Thomas Blankschein
Date: Tue, 10 Oct 2006 15:39
27 lines
2083 bytes
Hello,

I use BCB5 with Indy 8.0.22.

I want to implement a simple FTP client into my application to up- and 
download files from and to an inhouse ftp-server.

I use the TidFTP component and I like the idea of blocking mode. This 
prevents me from building something like a state machine.

But I have two problems:

1. How can I implement a timeout functionality? I tested the TidFTP 
component on my home pc with software firewall. If I don't answer the 
"Allow or reject internet connection"-dialog of the firewall software, 
my testprogram waits forever. In real life, if something is blocking the 
connection, I want to wait a number of seconds and then inform the user 
about the problem.

2. Several different exceptions are thrown, if something went wrong. For 
example, if I try to connect to a server which does not exist, I get an 
EidSocketError 'Socket Error # 11004'. This is not a very user-friendly 
information. Is there a way to translate the messages to a more friendly 
text like 'Server does not exist'? Is there a list of error codes?

Thanks,
Thomas
Technical Details
Message-ID: <452bbea0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a4c08b3f3e05ed6f,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 10 Oct 2006 17:39:12 +0200
From: Thomas Blankschein <thomas@blankschein.de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.12) Gecko/20050923 Thunderbird/1.0.7 Mnenhy/0.7.4.0
X-Accept-Language: de-DE, de, en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: TidFTP: Timeout and error translation?
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 88.70.76.44
Message-ID: <452bbea0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1160494752 88.70.76.44 (10 Oct 2006 08:39:12 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail