Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : Re: idTcpServer or idCmdTcpServer - D7 indy10.1.5
| Subject: | Re: idTcpServer or idCmdTcpServer - D7 indy10.1.5 |
| Posted by: | "Jacques Noah" (jacques.no..@btinternet.com) |
| Date: | Tue, 18 Apr 2006 23:14:47 |
> Most or all? It makes a big difference.
Well the clients have to sent their status to the server, for example when a
user has reached the end of their allowed internet access time, the client
would send a message back to the server telling it that it is 'free'. That
is the only communication between the server and the client apart from the
onConnect event.
Cheers
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:44452e6b$2@newsgroups.borland.com...
>
> "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