[Message Deleted]
-
[Message Deleted]
-
[Message Deleted]
I guess
gethostbyname("localhost")
may help. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
I guess
gethostbyname("localhost")
may help. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Thanks for your reply. I do not want to resolve the loopback address through naming services such as /etc/hosts file. I need to get the real loopback address configured with the machine irrespective of whether it is specified in /etc/hosts file or not. gethostbyname() will give me what is configured in /etc/hosts file. Is there any other mechanism to get the real loopback address of the machine e.g. reading the routing table etc.? Thanks and Best regards. Gajendra Sharma
Gajendra
-
Thanks for your reply. I do not want to resolve the loopback address through naming services such as /etc/hosts file. I need to get the real loopback address configured with the machine irrespective of whether it is specified in /etc/hosts file or not. gethostbyname() will give me what is configured in /etc/hosts file. Is there any other mechanism to get the real loopback address of the machine e.g. reading the routing table etc.? Thanks and Best regards. Gajendra Sharma
Gajendra
Gajendra Sharma wrote:
I do not want to resolve the loopback address through naming services such as /etc/hosts file.
Isn't it by definition [^], the loopback? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Gajendra Sharma wrote:
I do not want to resolve the loopback address through naming services such as /etc/hosts file.
Isn't it by definition [^], the loopback? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]loopback address can exist even if /etc/hosts file dosn't have an entry indicating it. Am i missing something?
Gajendra
-
loopback address can exist even if /etc/hosts file dosn't have an entry indicating it. Am i missing something?
Gajendra
Gajendra Sharma wrote:
loopback address can exist even if /etc/hosts file dosn't have an entry indicating it.
That's is true, I suppose, anyway it is not a point against my argument: since loopback is by definition the address resolved by name services, I guess that
gethostbyname
(orgetaddrinfo
[^]) will do the job. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Gajendra Sharma wrote:
loopback address can exist even if /etc/hosts file dosn't have an entry indicating it.
That's is true, I suppose, anyway it is not a point against my argument: since loopback is by definition the address resolved by name services, I guess that
gethostbyname
(orgetaddrinfo
[^]) will do the job. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Thanks for your help. I could solve the problem by enumerating local interfaces using WSAIoctl and then checking loopback net with flag IFF_LOOPBACK.
Gajendra