I have been checking all the demos and trying to understand about how to send a "Command" to a specific client and I simply can't find it!

You found it because you told us:

I have made this test procedure which works but only if there is just one client.

{This procedure sends the command to the clients and it works very nicely.}
procedure TSimpleSslServerForm.SendCommand;
begin
 SslWSocketServer1.Client[0].SendStr(ledSendCommand.Text); /// The PROBLEM
here is: How do I send the command to a specific client if I have more than
one client?
 Display('Command sent: ' + ledSendCommand.Text);
end;

Your problem is not how to send to a given client, you've done that with the first client (index is 0) and it is the same for any other client, just change the index.

Your problem is at the application level: How do I select the right client ? Said in other word: How do I find the index to use with Client[] property ?
We cannot answer that question for you because we don't know the criteria !
You can create a form to ask the user which IP the client has and then iterate thru Client[] array and look for the correct IP. Or you can show the list of clients on screen (again by iterating thru Client[] array) and let the user select the one he wants.

Do you understand what I mean ?

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to