[erlang-questions] how to get the factual ip address?
Wed Oct 29 09:22:02 CET 2008
getif/0 and getiflist/0 seem very useful, but shouldn't their output be in
sync order-wise with each other?
getif/0 in my machine outputs...
, while getiflist/0 outputs...
This might be a problem if you had several more interfaces available.
Knowing the output of both are always in sync might simplify things out.
>Computers have more than one IP address. E.g., yours has both
>127.0.0.1 <http://127.0.0.1/> and 192.168.1.101. Other computers have even
>inet module has undocumented functions getif/0 and getiflist/0 that
>might do what you want.
>Another possibility is to call inet:sockname/1 on an open socket to
>find what address the operating system used.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions