I am creating a TCP server which receives multiple clients and must be able to send messages to each.
How do I get a handle to the client connection and then send arbitrary data?
Thanks: D
Code:
procedure TFRM_Main.ServerConnect(AContext: TIdContext);
var lAdd: TListItem;
var Index: integer;
begin
lAdd := ListView.Items.Add;
//AContext connection ID, what to do here?
lAdd.Caption := IntToStr(Index);
end;
use:
For more options, just invoke the code completion(CTRL+SPACE) after IOHandler and see available options, some time ago, I’ve wrote a simple client/server test app, click here to see and/or download source.