I have a server application built using the TipwIPDaemon component. When clients connect the connected event is fired with the connectionid of the connection:
procedure TServLogic.IPDaemon1Connected(Sender: TObject;
ConnectionId, StatusCode: Integer; const Description: String);
The documentation states the TipwIPDaemon.connectioncount property returns the number of connections.
I was under the impression you would proceed as follows:
for i:=0 to ipd.connectioncount-1 do begin
remotehost := ipd.remotehost[i]
......
However, I am now finding this is not the case, and for calls such as ipd.remotehost[x] the subscript x represents a unique connectionid.
So for example say I get my first connection. From what I have learned this this is always connectionid=1. If a 2nd connection comes in and afterward the 1st is dropped, references for the 2nd connection are still ipd.remotehosts[2]
My question: Is there any internal list of the connection id which correspond to the conectioncount? Or do I have to maintain this myself? Say for example I want to send data to all connected clients. I seem to need a "list" of the connectionid:
for i:=0 to ipd.connectioncount-1 do begin
IPD.DataToSend[GetConnectionID(i)] := 'Hello There';
......