Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jan : [D7 + Newbie] Getting rid of "EIdSocketError 'Socket Error # 10004 "?
| Subject: | [D7 + Newbie] Getting rid of "EIdSocketError 'Socket Error # 10004 "? |
| Posted by: | "John Smith" (someo..@microsoft.com) |
| Date: | Wed, 11 Jan 2006 01:58:41 |
Hi
I'm a Delphi newbie, and didn't find a working answer in "Chapter 20 -
Overview of Internet Direct.pdf", "Chapter 21 - Using Internet Direct.pdf",
"Indy In Depth.pdf", or the FAQ or KB on Indy's site, and two people
(Kenneth Vandbęk and Brian) mentionned this error that pops up even under
normal disconnections but neither explains how to not be bothered with this
in either the IDE or compiled code... so here goes :-)
I'm actually PINGing a remote host regularly through a Timer to check if
it's alive. Can you tell me how to stop being bothered by this exception?
[code]
procedure TForm1.Timer1Timer(Sender: TObject);
begin
IdIcmpClient1.Host:= 'www.cisco.com';
IdIcmpClient1.Ping();
//Here, I get the exception, but don't know how to let it slip silently:
//Project tray.exe raised exception class EIdSocketError with message
'Socket Error # 10004
//Interrupted system call.'. Process stopped. Use Step or Run to continue.
case IdIcmpClient1.ReplyStatus.ReplyStatusType of
rsEcho:
ListBox1.Items.Add('Cisco is alive and well');
rsError:
ListBox1.Items.Add('Unknown error.');
rsTimeOut:
ListBox1.Items.Add('Timed out.');
rsErrorUnreachable:
ListBox1.Items.Add('Network unreachable.');
rsErrorTTLExceeded:
ListBox1.Items.Add('TTL expired.');
end; // case
PostMessage(ListBox1.Handle, wm_vscroll, SB_LINEDOWN, 0);
end;
[/code]
FWIW, I did try the following code, but I get an error "Undeclared
identifier: 'EIdException'":
[code]
try
IdIcmpClient1.Ping();
except
on E: EIdException do begin //[Error] Unit1.pas(85): Undeclared
identifier: 'EIdException'
ListBox1.Items.Append('Error : ' + E.Message);
case IdIcmpClient1.ReplyStatus.ReplyStatusType of
[/code]
Thank you!