<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
That looks good but unfortunately i get an error message which says
"Example instance has no attribute 'transport'"<br>
<blockquote cite="mid40AC23FE.5000302@nextwindow.com" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
<pre>Daniel Newton wrote:
><i>
</i>><i> I have a simple XML-PRC server similar to the example below:
</i>><i>
</i>><i> from twisted.web import xmlrpc, server
</i>><i>
</i>><i> class Example(xmlrpc.XMLRPC):
</i>><i> """An example object to be published."""
</i>><i>
</i>><i> def xmlrpc_add(self, a, b):
</i>><i> """Return sum of arguments."""
</i>><i> return a + b
</i>
def xmlrpc_whatIsMyAddress(self):
return self.transport.getPeer().host
<a class="moz-txt-link-abbreviated"
href="mailto:twisted-python-request@twistedmatrix.com">twisted-python-request@twistedmatrix.com</a> wrote:
><i>
</i>><i> if __name__ == '__main__':
</i>><i> from twisted.internet import reactor
</i>><i> r = Example()
</i>><i> reactor.listenTCP(7080, server.Site(r))
</i>><i> reactor.run()
</i>><i>
</i>><i> I want to be able to get the address of the client that calls the xmlrpc
</i>><i> method can anyone help me with this?
</i>><i>
</i>><i> thanks in advance
</i>><i>
</i>><i> Daniel Newton
</i>><i>
</i>
Jp</pre>
</blockquote>
</body>
</html>