Arunmu
Arunmu

Reputation: 6901

inet_addr functionality in erlang

As the question says, is there any function or module that performs the functionality of inet_addr ?

Results from google isnt suggesting any direct way or am i missing something ?

Thanks.

Upvotes: 0

Views: 203

Answers (1)

nos
nos

Reputation: 229058

You can use inet_parse:address, and then convert the resuting list to binary. e.g.

16> list_to_binary(tuple_to_list(element(2,inet_parse:address("192.168.42.2")))).

<<192,168,42,2>>

Upvotes: 3

Related Questions