Pregunta

Exactly what I want is: 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?

In client side, the browser will terminate that disconnected ajax(chunked) call with some timeout(Is it 4sec?) delay. Then I reconnect it later.

By the way,
how can I get the no. of existing subscribers registered by push_list_add()?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top