Re: Knowing how many clients are connected to a Proxy

Irmen de Jong <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
On 9-1-2013 18:07, Pedro Cardoso wrote:
> Hi Irman,
> 
> I think I will take a look at the sockets list as I am using multiplexing server.
> 
> But, going a little further in the definition of idle deamon.
> 
> 
> I want to create deamons to work in burst mode. This is: they are created when they are
> going to be needed by a few clients, but after a while when all clients have done their
> work and gone, the deamon becomes idle, and should kill himself.
> 
> So, by idle mode on the deamon, I define that he have client connection for more than 30
> minutes. 
> 

Ok, perhaps another way is to override/monkeypatch daemon.handleRequest() to track the
last time a request was processed. Another process/thread could monitor this
periodically and then shut down the daemon if the last request was more than X minutes ago.
This way you also shut down daemons that still have open connections but whose clients
haven't been doing anything (perhaps having dangling open proxy objects). This may or
may not be what you want.


Irmen


------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.