Don't call getpeername when you already have the ip address.
Fixed unit tests.