Avatar of dolphin King
dolphin King
 asked on

Broadcast a message using ICS

i dont know if i do it right but here what i am doing


type
  TMyClient = class(TWSocketClient)
  private
    Connected: TDateTime;
    UniqueID: DWORD;
    procedure ConnectionDataAvailable(Sender: TObject; ErrCode: Word);

  public
    constructor Create(AOwner : TComponent); override;
    destructor Destroy; override;
    procedure Display(Msg: String);
  end;


procedure TMyClient.BroadcastMessage(const message : string);
var
Client : TMyclient;
Server : TWSocketServer;
I : integer;
begin
Server := mainserver.server;
for I := 0 to server.ClientCount -1 do
begin
  Client := TMyclient(server.Client[I]);
//do send
end;

end;

Open in new window


is my broadcast is correct ? i think its totally wrong because i use Server := mainserver.server; i dont feel good about this i am new to ics where to access the context list same way in indy with connection class ?
Delphi

Avatar of undefined
Last Comment
Sinisa Vuk

8/22/2022 - Mon
Joan Lewis

Hello Dolphin King,

Just go with this source it might help you to in right way: http://www.w3eoc.org/usingics213
ASKER CERTIFIED SOLUTION
Sinisa Vuk

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck