Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Feb : TIdCmdTCPClient sending to server
| Subject: | TIdCmdTCPClient sending to server |
| Posted by: | "Moore" (moo..@hotmail.com) |
| Date: | 19 Feb 2008 03:11:31 |
I have a TCP server (external application) that sends some commands (with params) to clients without petition from thos, and may also send commandos on petition from the client,
i need on connecting to send a petition to receive a command (DEVSTATUS) that contains info on the hardware in the server, and then listen to commands (DEVADD, DEVMOD, DEVDEL etc.) coming from it informing on harware status,
what i have done is on form creation connect to the server (form create), receive the hello string with readln(client onconnect), and send the petition for info with writeln (from create), which i receive immediately (readln), no command handler for this first command is created,
for later commands i have created command handlers for each one, and they are received and treated adecuately,
all this functions well, except that sometimes as it seems messages overlap and the app loads without data so i have to shut the app and run it again to load good, this passes only somtimes,
which made me think to include the first command (DEVSTATUS) in a command handler, the problem with that command is that to receive it the client must send a command (CLIENT), which i make in the oncreate, but the results are not the desired ones and the app is much more slow in the GUI, and data never received correctly,
Is there a better approach to combine receiving commands with petition and those without petition maintaining the flow of data from the server without messages overlapping and the GUI being slow
Note : when creating a command handler only for commands without petition from the client, the GUI is normal and data is received adecuately..