Re: HTTPServer # of Threads

Giganews Newsgroups
Subject: Re: HTTPServer # of Threads
Posted by:  Remy Lebeau (TeamB) (
Date: Thu, 30 Oct 2003

"steve" <csufsurf…> wrote in message
> I'm trying to figure out how many threads are currently
> executing on a server at a given time.  I figured it would be
> in IdHTTPServer1.ThreadMgr.ActiveThreads  but I can't
> find a Count property.

ActiveThreads is a TThreadList.  You have to call LockList() first in order
to access the actual list:

        iCount: Integer;
        pList: TList;

    with IdHTTPServer1.ThreadMgr.ActiveThreads do
        pList := LockList;
        iCount := pList.Count;

    // use iCount as needed

> I did see IdHTTPServer1.Bindings.Count but that number
> stayed at 1 when I had multiple client connections.

As it should.  There is a Binding for each IP/Port combo that the server is
listening on, that does not change while the server is still active.

> I'm not familiar with Bindings but it seems that it has more to do
> with the socket information that it is bound to not the clients that
> connect to it.




In response to

HTTPServer # of Threads posted by steve on Thu, 30 Oct 2003