• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
local host IP address on X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: local host IP address on X
      • From: Quinn <email@hidden>
  • Prev by Date: PPPoE Menu Bar Status - Programmatic Toggling
  • Next by Date: Re: local host IP address on X
  • Previous by thread: PPPoE Menu Bar Status - Programmatic Toggling
  • Next by thread: Re: local host IP address on X
  • Index(es):
    • Date
    • Thread