I know we can get the client (host) IP after connection has been established because at that time we will have transport attribute:
self.transport.getPeer()
but how do I get the IP address of the client in twisted TCP server when it lost connection to the server, as in after it got disconnected.
Its a little late for that. I suggest you save this information when you have it. For example: