Article View: borland.public.cppbuilder.internet.socket
Article #5657Re: Send message to all TIdServerSocket connections
From: Remy Lebeau (TeamB)
Date: Thu, 01 Jul 2004 17:26
Date: Thu, 01 Jul 2004 17:26
25 lines
1562 bytes
1562 bytes
"Alfred Thomas" <alfred@fischerint.co.za> wrote in message
news:40e411f8$1@newsgroups.borland.com...
> I am trying to send a message to all the clients connected
> to a TIdTCPServerSocket component.
There is no such component name. Perhaps you mean TIdTCPServer instead?
> I have tried the following:
You should be looping through the ActiveThreads list instead:
TList *pList = ServerSocket->ActiveThreads->LockList();
try
{
for(int k = 0; k < pList->Count; ++k)
static_cast<TIdPeerThread*>(pList->Items[k])->Write("XXXXX");
}
__finally {
ServerSocket->ActiveThreads->UnlockList();
}
Gambit
Technical Details
Message-ID:
<40e4492e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40e411f8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,8030c97762119088 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <40e411f8$1@newsgroups.borland.com> Subject: Re: Send message to all TIdServerSocket connections Date: Thu, 1 Jul 2004 10:26:16 -0700 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.10 Message-ID: <40e4492e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088702766 68.69.17.10 (1 Jul 2004 10:26:06 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail