> 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;
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
SslWSocketServer1.Client is an array of your clients.
So if you have 2 clients, the first one is Client[0] and the second
one is Client[1].
If you have a third client then he's at Client[2].

I think you get the picture

so change your procedure to something like this :
procedure TSimpleSslServerForm.SendCommand(ClientNo: integer);
begin
 SslWSocketServer1.Client[ClientNo].SendStr(ledSendCommand.Text);
 Display('Command sent: ' + ledSendCommand.Text);
end;

The number of connected client is available in TWSocketServer.ClientCount

hth
--
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