Hi!
I am having a bit of a problem getting the local address of my computer. For example, my IP is something like [tt]192.68.1.100[/tt]. When a do a [tt]ifconfig -a[/tt], I can see that eth0 is assigned the said IP. So naturally, I tried getting the IP using the socket APIs. However, no matter how hard I try, I always keep on getting [tt]127.0.0.1[/tt] or any of the loopback addresses. I can't get the [tt]192.68.1.100[/tt]. What should I do to get the said IP using socket APIs.
NOTE: [tt]192.68.1.100[/tt] is not defined in my /etc/hosts file. Will this be a problem? However, I need to get the [tt]192.68.1.100[/tt] even though it was not specified in the /etc/hosts file.
Rome did not create a great empire by having meetings, they did it by
killing all those who opposed them.
- janvier -
I am having a bit of a problem getting the local address of my computer. For example, my IP is something like [tt]192.68.1.100[/tt]. When a do a [tt]ifconfig -a[/tt], I can see that eth0 is assigned the said IP. So naturally, I tried getting the IP using the socket APIs. However, no matter how hard I try, I always keep on getting [tt]127.0.0.1[/tt] or any of the loopback addresses. I can't get the [tt]192.68.1.100[/tt]. What should I do to get the said IP using socket APIs.
NOTE: [tt]192.68.1.100[/tt] is not defined in my /etc/hosts file. Will this be a problem? However, I need to get the [tt]192.68.1.100[/tt] even though it was not specified in the /etc/hosts file.
Rome did not create a great empire by having meetings, they did it by
killing all those who opposed them.
- janvier -