local host IP address on X
local host IP address on X
- Subject: local host IP address on X
- From: Kevin Parichan <email@hidden>
- Date: Mon, 15 Jul 2002 20:02:56 -0700
I'm porting some Windows WinSock code to the Mac. The 8/9 version works
fine via a 3rd party sockets library, but the X version is having
problems. I'm trying to determine the local host IP address. The original
code is using gethostname, gethostbyname, then inet_ntoa. What's coming
back is a list of one item with the address 127.0.0.1. This obviously
doesn't match what is in the Internet Connect window and not what I
expected. If I use OTInetGetInterfaceInfo it returns the same thing at
the Internet Connect window. I looked at the Stevens book, and other than
using uname instead of gethostname, is basically doing the same thing.
I'm new to the sockets stuff, so what is it that I'm not understanding or
doing wrong?
=kp
_______________________________________________
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.