🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TidFTP: Timeout and error translation?

#1843
From: Remy Lebeau (TeamB)
Date: Tue, 10 Oct 2006 17:53
30 lines
1979 bytes
"Thomas Blankschein" <thomas@blankschein.de> wrote in message
news:452bbea0@newsgroups.borland.com...

> I use BCB5 with Indy 8.0.22.

That is a very old version of Indy that is no longer supported.  You should
seriously consider upgrading.

> How can I implement a timeout functionality?

Indy 8 did not support that.  You will have to upgrade to Indy 9 for that.

> 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'?

WinSock error codes can be passed to the Win32 API FormatMessage() function.
The VCL has a SysErrorMessage() function that wraps FormatMessage().
EIdSocketError has a LastError property that you can pass to
FormatMessage/SysErrorMessage().

> Is there a list of error codes?

You have to look in the WinSock API documentation.


Gambit
Technical Details
Message-ID: <452bdea3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <452bbea0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a4c08b3f3e05ed6f
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <452bbea0@newsgroups.borland.com>
Subject: Re: TidFTP: Timeout and error translation?
Date: Tue, 10 Oct 2006 10:53:59 -0700
Lines: 32
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: 69.169.4.232
Message-ID: <452bdea3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1160502947 69.169.4.232 (10 Oct 2006 10:55:47 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail