Re: Knowing how many clients are connected to a Proxy

Pedro Cardoso <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <CADu+LGOkEpPs9JL+Qs+Rr-i-MWCHZXiB+s+=8Z8SfXGogjd8Mw@mail.gmail.com>
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.



2013/1/9 <pyro-core-request-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>

> From: Irmen de Jong <[email protected]>
> To: [email protected]
> Cc:
> Date: Tue, 08 Jan 2013 22:31:12 +0100
> Subject: Re: [Pyro] Knowing how many clients are connected to a Proxy
> On 8-1-2013 16:02, Pedro Cardoso wrote:
> > Hi,
> >
> > I have a server (Deamon) running, and I would like to know how many
> clients (Proxies) I
> > have connected to it.
> >
> > The objective is to kill a deamon if it is inactive after a long time.
> >
> > Pedro
>
> Hello Pedro,
>
> At this time, Pyro hasn't got a public API to do this.
> There's an item on the todo list though to add something like this (but
> until now, it
> hasn't really been requested before)
>
> Your best bet now would probably be to override Daemon._handshake in a
> subclass or
> monkeypatch it, and let it track the number of connection handshakes it
> receives.
> There's no way of knowing when a client went away though...
>
> For a multiplexing server you could count the
> Daemon.transportServer.sockets list, which
> contains all active client sockets and the daemon server socket. This
> makes no sense on
> the threadpool server though (it will always only contain the daemon's
> server socket).
>
> Maybe you can define "inactive daemon" more precisely so that we might
> think of a
> possible other solution to your problem?
>
>
> Regards
> Irmen de Jong

------------------------------------------------------------------------------
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

_______________________________________________
Pyro-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyro-core
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.