I have a computer on a small network, so my ip is 192.168.2.100.
I am trying to get my real ip. I download the no-ip client but that just seems like a lot of trouble
Some routers can tell you their external IP address via UPnP, or more specifically, the IGD protocol. If you happen to own an UPnP enabled router, you can try this. IStaticPortMapping::get_ExternalIPAddress sounds promising.
SNMP enabled devices can tell you their IP addresses, too. The OID to ask for is IP-MIB::ipAdEntAddr.
When I need to check my public ip address, I like this website:
http://www.whatismyip.global/
The website keeps a history of your IPs. For me is very usefull!
Do note reinvent the wheel, there is a standard protocol, STUN (with already existing implementations), just for that. See also Discovering public IP programatically.
I always use curl http://whatismyip.org
to get my public IP while behind NAT.
I can't think of how you would resolve your IP address from the perspective of another machine. Here's a couple thoughts:
Unfortunately, you're server will most likely be completely oblivious to what it's own External address appears to be (as it might be set further upstream via some router/gateway)
You could have a look at this link
http://ip-address.domaintools.com/myip.xml
It might be a little easier to parse than what you're currently doing.