Article View: borland.public.cppbuilder.internet.socket
Article #5480Exception Handling
From: mike
Date: Tue, 10 Aug 2004 14:41
Date: Tue, 10 Aug 2004 14:41
43 lines
1898 bytes
1898 bytes
Could someone explain to me how to handle an exception when trying to open a
connection from a TClientSocket.
Heres what is happening;
I issued the following.
try
{
Form1->ClientSocket1->Open()
;
;
}
catch (...)
{
ShowMessage("Error");
}
Now I have purposly placed an invalid host into the Form1->ClientSocket1 so
that an exception will occur, and it does.
I also have the Error Event returning 0 if I get an error.
So what happens is this.
The first time I issue the open command, the Disconnect event is fired, and
then the Exception displays a message. No error even is fired.
If I issue the open command again, no Disconnect event is fired, an Error
event is fired, No Exception is fired.
If I repeat the open again, the first condition occurs again.
So I don't understand how to catch the exception, or why the actions are
different between the first open and the second open.
Can someone help me with this.
Thanks for any information.
Mike
Technical Details
Message-ID:
<4118e06b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,234111ec25ac0a9d,start X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "mike" <mfbrowne@earthlink.net> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Exception Handling Date: Tue, 10 Aug 2004 10:41:31 -0400 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 68.204.190.196 Message-ID: <4118e06b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1092149355 68.204.190.196 (10 Aug 2004 07:49:15 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail