Problem on Contexts.LockList

Giganews Newsgroups
Subject: Problem on Contexts.LockList
Posted by:  Diego Cerutti (diego.cerut…@gmail.com)
Date: Wed, 6 Aug 2008

Hi,
I have a client and a server using TCP by Indy 10.
I used a TMyContext(TIdContext) class for save client information on
connection.
The system works well, but when I make this:

List : TList;

List := tcpServer.Contexts.LockList;
try
  for i := 0 to List.Count-1 do begin
    with TMyContext(List[i]) do begin
          lbUsers.Items.Add('User: ' + Name + ' @ ' + LocalIP);
    end;
  end;
finally
  tcpServer.Contexts.UnlockList;
end;

the number of added users on lbUsers is less than the
tcpServer.Contexts.LockList.Count.
eg: tcpServer.Contexts.LockList.Count = 12
      lbUsers = 7

Sorry my bad english

Replies