문제

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.

도움이 되었습니까?

해결책

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>>

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top