Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : TIDCmdTCPServer and TIDTCPClient
| Subject: | TIDCmdTCPServer and TIDTCPClient |
| Posted by: | "Roberto Colpani" (roberto.colpa..@vetrariafratellicolpani.it) |
| Date: | Mon, 19 Jun 2006 16:44:15 |
If I want to send from my server to every my connected user a msg, on the
server side, can I use this code?
TMainForm.IdCmdTCPServer1CommandHandlers2Command(ASender: TIdCommand);
Var
AList: TList;
I: Integer;
begin
AList := IdCmdTCPServer1.Contexts.LockList;
try
for Index := 0 to AList.Count - 1 do
begin
if ASender.Context.Connection.Socket.Binding.PeerIP <>
TIdContext(AList[I]).Connection.Socket.Binding.PeerIP then
begin
TIdContext(AList[I]).Connection.IOHandler.WriteLn('@something to
read');
end;
end;
finally
IdCmdTCPServer1.Contexts.UnlockList;
end;
end;
How can I intercept this message from my clientside?
It 's good idea having a timer that check every a second the
IOHandler.ReadLn function of the TIDTCPClent?
Thanks.