How to track number of clients with Indy TIdTCPServer

后端 未结 4 489
Happy的楠姐
Happy的楠姐 2021-01-03 07:37

I want to know the number of current client connections to an Indy 9 TIdTCPServer (on Delphi 2007)

I can\'t seem to find a property that gives this.

I\'ve tr

4条回答
  •  一生所求
    2021-01-03 08:33

    How about incrementing / decrementing a counter from OnExecute (or DoExecute if you override that)? That can't go wrong!

    If you use InterlockedIncrement and InterlockedDecrement you don't even need a critical section to protect the counter.

提交回复
热议问题