. I don't know what you mean by "multiple ports" in that you could mean multiple destinations or multiple source ports. Either way, the 'peeraddr' or 'peerhost' or 'peerport' method in
will get the address of the remotely connected client, while 'sockaddr'/'sockhost'/'sockport' will do the same for the local end.