|
Re: How do I find my own IP address?: msg#00265lang.erlang.general
On Thu, 22 Jan 2004 15:07:14 +0100 Joachim Durchholz <joachim.durchholz@xxxxxx> wrote: > Samuel Rivas wrote: > > Following your discovery I've found out an (undocumented) way to get > > the host IP within Erlang: > > > > 1> {ok, S} = inet_udp:open(0, []). > > {ok,#Port<0.4112>} > > 2>prim_inet:ifget(S, "eth0", [addr]). > > {ok,[{addr,{192,168,100,100}}]} > > This will work on a vanilla Unix system. Not even there (depending on your interpretation of 'vanilla Unix') - the BSD's have not traditionally had interfaces named eth*. They're named after the specific devices (ed*, rl*, dc*, etc) instead. -Chris |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: ANNOUNCE ex11 release two: 00265, Miguel Barreiro |
|---|---|
| Next by Date: | Re: How do I find my own IP address?: 00265, Joachim Durchholz |
| Previous by Thread: | Re: How do I find my own IP address?i: 00265, Joachim Durchholz |
| Next by Thread: | Re: How do I find my own IP address?: 00265, Miguel Barreiro |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |