Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Apr : Indy TCP Server Component

www.cryer.info
Managed Newsgroup Archive

Indy TCP Server Component

Subject:Indy TCP Server Component
Posted by:"Graham Powell" (grah..@deephaven.co.uk)
Date:Fri, 8 Apr 2005 15:26:30

I am new to using this component, so please bear with me. To date I have
always used the Delphi TServerSocket but need to see if the Indy Server
performs better in my current circumstances.

In the Indy Execute routine I am monitoring for data to be sent from the
main application thread. The remote client makes a connection and the
Execute event begins to be called. Any available data is then sent. Up to
this point all is fine. However, if the client disconnects, the Indy Server
component does not generate a Disconnect event and the Execute event keeps
on being called. If the client then reconnects, the effect is that the Indy
server now thinks there are two client connected.

Is this true? And Am I missing something in setting up the Server?

My Execute routine looks like this:

procedure Execute (AThread: TIdPeerThread);
begin
  if data_available then
  begin
    AThread.Connection.Write (my_data);
  end;

  Sleep (1);
end;

I seem to need the Sleep otherwise the main application starts to go very
slow.

The client socket is a Delphi TClientSocket, just in case that makes any
difference.

Any help much appreciated.
  Graham

Replies:

www.cryer.info
Managed Newsgroup Archive