I'm using Pythons SocketServer.ThreadingTCPServer. Now I want to know how many clients are connected at a certain moment.
How to solve this?
In a thread that "serves" client use some global count that is increased when client connects and decreased when disconnects.
If you want to count from OS level then use nestat -an with proper grep filter and wc -l (on Windows uses ports of grep and wc)
How to count connected clients in TCPServer?