While this was already answered, I thought I would add my own quickly, so I will not forget about it in the future ... As you know, the documents for Twisted ... are well twisted ...
def connectionLost(self): ip, port = self.transport.client print ip print port
Using the above, you can simply map ip / port to some kind of database or keep in mind client tracking.
I ended the search with print vars(self.transport) and saw the client object in the output / console ... using the classic php debugging here
source share