views:

92

answers:

1

I wish to get a list of connections to a manager. I can get last_accepted from the servers' listener, but I want all connections. There HAS to be a method I am missing somewhere to return all connections to a server or manager Please help!!

A: 

Looking at multiprocessing/connection.py, the listener just doesn't seem to track all connections -- you could, however, subclass it and override accept to append accepted connections to a list.

Alex Martelli
Thanks Alex, this is where I was going with this problem. It seems odd that the 'manager' does not keep track of the connections made to it, meaning it cannot really manage them. I thought I had missed something.Thanks again
tranimatronic
subclassing connection.Listener.accept() is not nearly as easy as it sounds.BaseManager.get_server() returns a server that names connection.Listener in the definition of listener_client - so the subclass of Listener is overridden whenever a Server is returned by get_server().Basically I had to override BaseManager.get_server() to return a changed version of Server using my overridden Listener rather than the one it is receiving from listener_client.It works, but it does seem long way round to be able to return a list of connections to my manager.Alternatives anyone ??
tranimatronic