TIDTCPCMDServer multi broadcast lists

Using Indy 10

Looking for a faster way to support multiple broadcast lists for multiple chats on same TcpCmdServer component

For example, if client #1 is in 3 chats, it will be in 3 lists, etc..

at this time, i'm using a very time consuming loop to search for a match of the peerIP within a specific string.

 
  ContextsList := svr.Contexts.LockList;
  with ContextsList do
  begin
    for i := 0 to svr.Contexts.Count-1  do
    begin
      cx := ContextsList[i];
      if pos(cx.peerIp, sBroadcastList)>0 then
        cx.Binding.Send(s);
    end;
  end;

Open in new window

TIA
controlrAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sinisa VukSoftware architectCommented:
Maybe you can use TList where you can store unique client id (maybe if you transfer ip address from string
to integer v1.v2.v3.v4 --> v1*16777216+v2*65536+v3*256+v4) - searching integer is faster than string.
0
controlrAuthor Commented:
that will be actually slower, as the user ID is already sorted and IP's are a secondary field..

Would TIDTCPCMDServer  be able to handle a paralleled  loop workload on  the connections?  or will it cause issues?
0
controlrAuthor Commented:
as it stands, the current implementation is the fastest.
thanks for the effort.  partial points awarded
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
controlrAuthor Commented:
partial points for efforts, solution is not faster than current implementation
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.