Should I use TIdCmdTCPServer and TIdCmdTCPClient together?

I am trying to write a server and a set of clients that are talking to the server. The server will maintain the status of different clients and allows them to notify the central server when the status changes. The client specialist will allow you to control other connected clients.

I have a server like TIdCmdTCPServer, and clients (currently) are connecting using TIdTCPClient.

If clients send and receive commands, should they use TIdCmdTCPClient? I read that CmdTCPServer and CmdTCPClient are not actually used together - shouldn't they be used together?

So I apologize for the general vagueness of the question, but I just really started to look at it and need some heads before I get into the details.

Thanks for any help

Mark h

+3
source share
3 answers

It is technically possible to use TIdCmdTCPClient and TIdCmdTCPServer together, but in general this is not practical. These components are designed to process incoming commands asynchronously. It does not make sense for the client to wait for a server command, but to have a server waiting for a client command at the same time. This is a good way to block your connection, as they both are waiting for data from each other, and neither actually sends anything without input.

+4
source

Maybe you can start by testing demos

+2
source

TIdTCPServer does not receive anything on Android (error). Android can only send data from I tidtcpclient to Windows TidTCPServer, and not vice versa.

+1
source

Source: https://habr.com/ru/post/1728374/


All Articles