
July 26, 2005
11:04 a.m.
On Mon, 2005-07-25 at 10:53 -0500, J French wrote:
Is there an accessible method to retrieve a peer's ip address from within pb? I just want to log it.
I read the Faq and see how to do it when subclassing protocol i.e.: class MyProtocol(protocol.Protocol): def connectionMade(self): print "connection from", self.transport.getPeer()
I'd appreciate it if someone can point me in the right direction.
remoteReference.broker.transport.getPeer() will do it. The broker attribute of RemoteReferences is the protocol instance they are connected to.