when the system resource is not enough to add a new subscriber, how to disconnect(may be randomly) an existing subscriber to make room for that newly registered one?
You should not have to care about this because G-WAN will not exhaust system resources. Instead, it will close client connections it canot answer too (if system resources are too low to accept a new connection).
how can I get the no. of existing subscribers registered by push_list_add()?
There's no difference in terms of system resources so you should rather use the more relevant (CC_ACCEPTED - CC_CLOSED)
value obtained from the get_env()
API call: http://gwan.ch/api#env
Just looking at the CLIENT_SOCKET
is a relevant hint about how high system resources are used by concurrent client connections.