I\'m looking to obtain my own IP address in order to publish that information in to a Peer-to-Peer network. In POSIX/C we have getaddrinfo(NULL, ...), but this
By public address, you're saying, an address that your application's peers can contact you with. The only full-proof way is to connect to a known "external" peer and have it send your address back to you.