[Twisted-Python] anyway to know client address in XMLRPC?

Remi Cool mailinglists at smartology.nl
Thu Mar 29 03:24:05 MDT 2007


wang wei wrote:
> hello, I need to know the client address connected to my Twisted
> XMLRPC server, is there any way?
> the fellow code couldn't work in my machine.
> class Examle(xmlrpc.XMLRPC):
>     """An example object to be published."""
>
>         
>     def _getPeerAddress(self):
>             return self.request.getClientIP()
>             
>     def render(self, request):
>         self.request = request
>         xmlrpc.XMLRPC.render(self, request)
>
>
> the result is said:
> "C:\Python24\lib\site-packages\twisted\web\server.py:272: UserWarning: Warning! r
> equest.finish called twice.
>   http.Request.finish(self)"
> then how can I get client address in twisted?
>   
Try:

def render(self, request):
    self.request = request
    return xmlrpc.XMLRPC.render(self, request)


- Remi -




More information about the Twisted-Python mailing list