Re: Problem in getting local IP through
Re: Problem in getting local IP through
- Subject: Re: Problem in getting local IP through
- From: Joshua Graessley <email@hidden>
- Date: Tue, 24 Jun 2003 11:03:41 -0700
I'm not sure how you're using inet_ntoa to get the local IP address.
You should use getifaddrs. getifaddrs will return a list of all IP
addresses, not just one. Are you really sure you need to know the
address? When binding, it is best to just by to INADDR_ANY. If you're
sending your address across the wire, you will start to run in to all
sorts of nasty problems with things such as NAT and scoped addresses.
-josh
On Tuesday, June 24, 2003, at 5:24, Pranav Kumar Sahu wrote:
Hi All,
I am using "inet_ntoa" to get the local IP. In some systems it returns
me
proper IP. But in some system's it give 127.0.0.1 i.e loopback IP. Is
there
some network setting required, that are missing on some systems ?
Rgds
Pranav Kumar Sahu
QUARK MEDIA
Ext :9742
--Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege reserved for those who try.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.