The ClientCount read-only property returns the number of
active client sessions that have been established with the server.
The value returned by this property does not include clients that
are in the process of terminating. For example, if the Suspend
method is called to suspend the server and terminate all of the client
connections, each client is signaled to disconnect from the server and
the active client count is immediately set to zero. Once a client has
been signaled to disconnect, it is no longer considered to be an
active client connection even if that session does not terminate
immediately. This means that you cannot use this property value to
determine the number of clients in the process of disconnecting from
the server or when all clients have disconnected.
To determine when all clients have disconnected from the server
after the Suspend or Restart method has been called,
you must implement an OnIdle event handler. This event occurs
after the last active client session has terminated.