tags:

views:

220

answers:

2

Hi, I am trying to write a server and a set of clients that talk to the server. The server will maintain the status of different clients and allow them to alert the central server when there is a status change. A specialist client will allow the control of the other connected clients.

I have the server as a TIdCmdTCPServer and the clients (at the moment) connect using TIdTCPClient.

If the clients are sending and recieving commands, should they use TIdCmdTCPClient? I have read that the CmdTCPServer and CmdTCPClient are not really used together - is it that they don't have to be used together?

So apologies for the general vagueness of the question, but I have only really just started looking at this and need a sort of heads out before I get bogged down in details.

Thanks for any help

Mark H

+1  A: 

Perhaps, you can start by testing demos

Hugues Van Landeghem
This has helped, but is still not quite want I want to do.
Mmarquee
+1  A: 

It is technically possible to use use TIdCmdTCPClient and TIdCmdTCPServer together, but in general it is not advisable. Those components are designed for processing inbound commands asynchronously. It does not make sense to have a client waiting for server commands, but to have a server waiting for client commands at the same time. That is a good way to deadlock your connection, as they are both waiting for data from each other, and neither is actually sending anything without input first.

Remy Lebeau - TeamB
So I should have the server as TIdCmdTCPServer, and then any replies or unsolicited messages should be handled by a standard TIdTCPClient, as per the examples the demos link below ?
Mmarquee
It really depends on the particular design of your communication protocol.
Remy Lebeau - TeamB