Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Localhost IP



Hi there!

I have a little question for you all. I try to get the local IP of my
system. I came to this solution:

char name[32];
hostent* host;

gethostname(name, 32);
host = gethostbyname(name);

while(host->h_addr_list[i] != NULL) //display IPs here.

Works great but only for 127.0.0.1, not my other 192.168.0.10 IP.

Is there a way to bypass that? Find the IP and go to sleep?;)

Thanks for your help and support,

Julien Guimont,
email@hidden
http://www.juggysoft.com
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.