Reading Strings with TCPServer/Client

Giganews Newsgroups
Subject: Reading Strings with TCPServer/Client
Posted by:  Tobias Müller (ne…@twam.info)
Date: Fri, 19 Sep 2003

Hi,

I'm using Delphi 6 and I'm new to Indy. I only used Delphi's ClientSocket
and ServerSocket before, but now I'm testing Indy. I want to realize a
simple program.

- Wait for messages (strings) on port 1234
- Look if the contain a string like "-replaceme-"
- Send the to another server on port 5678
- If the server replies, also replace the string and send it back to the
client.
- The connection should stay connected until the client disconnects

With the ClientSocket and ServerSocket components I could use the
OnClientRead/OnClientWrite and OnRead/OnWrite Events but I can't find suck
Events in the TCPServer and TCPClient component of Indy. How to realize
this?

Thanks in advance and Greetings from Germany
  Tobias

Replies