Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Nov : receive events on IdTCPClient
| Subject: | receive events on IdTCPClient |
| Posted by: | "JD" (shanba..@attglobal.net) |
| Date: | Fri, 25 Nov 2005 10:09:16 |
I'm trying to set up a test of a TCP client and server, in which the client
connects to the server, and the connection remains open indefinitely. Once
the connection is established, each communications session - a short
exchange of structured packets of (mostly) text - is initiated by the
"server" (and I can't change that).
With an IdTCPClient on the client side, I find that I can read a message
from the server (which uses IdTCPServer) sent during the server's OnConnect
event, by using IdTCPClient.GetResponse.
However, the actual messages exchanged don't have the form expected by
GetResponse, and I haven't been able to get the client to read any messages
from the server using any other methods. I've tried adding IDIOHandlerStack
and IdTCPConnectionIntercept components to try to use the OnReceive events
in the latter, but this doesn't seem to fire when the server transmits to
the client... which is what I really need; an event on the client that
signals to the client that data has arrived from the server.
I suspect there's a way to do this; does anyone know how?