Subject RE: [ib-support] Re: win98 connections
Author Pete Bray
here's a code snippet to ping a server which should work for localhost or
127.0.0.1

it's using the excellent Indy comms components

var TCPping: TIdTCPClient;

TCPping.Host:=Config.ServerName;
//this is the IB service port, without needing service file
TCPping.Port:=3050;
Screen.Cursor:=crAppStart;
try
TCPping.Connect();
except
//catch all socket exceptions, not interested!
end; //of except
Screen.Cursor:=crDefault;
if TCPping.Connected then
begin
IsServerOK:=true;
try
TCPping.DisConnect();
except
//catch all socket exceptions, not interested!
end; //of except
end; //of if
if not IsServerOK then etc....


Kind regards,
Pete Bray

> -----Original Message-----
> From: Jill Thomson [mailto:jthomson@...]
> Sent: 03 October 2001 18:59
> To: ib-support@yahoogroups.com
> Subject: Re: [ib-support] Re: win98 connections
>
>
> At 02:26 PM 02/10/01 -0600, Hans wrote:
> >Just a thought
> >
> >Issue command 'PING 127.0.0.1'
> >
> >A reply, TCP/IP installed
>
> Interesting idea - doing it programmatically may be a bit of a challenge
> (for me, anyway). ShellExec I suppose, but how to handle the response?
>