SimpleXMLRPCServer - revisited

Jan Danielsson jan.m.danielsson at gmail.com
Tue Apr 3 23:52:42 EDT 2007


Hello all,

   I want to be able to determine the IP address of the client making an
XMPRPC call.

   I got the tip to use this:
-------------------------------
class RPCServer(SimpleXMLRPCServer):

    def _dispatch(self, method, params):
        """Extend dispatch, adding client info to some parameters."""
        if method in ({my list of methods I needed client address}):
            return SimpleXMLRPCServer._dispatch(self, method,
                                       params+(self.client_address,))
        return SimpleXMLRPCServer._dispatch(self, method, params);
-------------------------------

   But it complains that it can not find 'client_address'.

   It may be relevant to point out that I am using this:

-------------------------------
class AsyncXMLRPCServer(SocketServer.ThreadingMixIn,SimpleXMLRPCServer):
   pass
-------------------------------

   If anyone has any hints or tips.. Please share them.

-- 
Kind regards,
Jan Danielsson



More information about the Python-list mailing list