Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : Re: idTcpServer or idCmdTcpServer - D7 indy10.1.5

www.cryer.info
Managed Newsgroup Archive

Re: idTcpServer or idCmdTcpServer - D7 indy10.1.5

Subject:Re: idTcpServer or idCmdTcpServer - D7 indy10.1.5
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 18 Apr 2006 11:19:51

"Jacques Noah" <jacques.noah@btinternet.com> wrote in message
news:44450a0d@newsgroups.borland.com...

> What i want to do is to have a client/server system were the
> server sends most of the commands and the clients just reply

Most or all?  It makes a big difference.

> Firstly, i would like to know what component is the best suited
> for this task between idTcpServer and idCmdTcpServer?

You need to answer the above question first.  Your answer to that question
will control which component to use.

> Also, i've worked with the idTcpServer before, so i know how to
> send and recieve commands with it, does idCmdTcpServer use the
> same methods to send and recieve cmds?

TIdTCPServer does not handle any commands automatically.  It only has the
OnExecute event available, so you have to do all handling yourself.

TIdCmdTCPServer is a dedicated receive-commands/send-replies type of server.
It cannot send commands to clients, unless those commands are sent in
response to commands that it received.  In other words, receive a command,
then immediately send a command, then receive the response, then send the
response to the original command.  Or receive a command, then send the
response, then immediately send a command, and then recieve the response.

> For example, if i have a cmd called 'status' how would i send it to the
client from the server using a button?

Via the SendCmd() method, just like you would if the client were sending a
command to the server.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive