如何在Erlang中启动inets?

时间:2013-06-10 08:27:50

标签: erlang inets

{ok, Pid} = inets:start(httpd, [{port, 0},
2>       {server_name,"httpd_test"}, {server_root,"/tmp"},
2>       {document_root,"/tmp/htdocs"}, {bind_address, "192.168.0.31"}]).
** exception error: no match of right hand side value {error,{failed_determine_ip_address,"192.168.0.31",inet6fb4,
                                                                                          nxdomain}}

当我尝试如上所述启动inets时,我收到一条错误消息。为什么会这样?我复制了&从API文档粘贴,但我仍然无法启动inets。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:5)

尝试将绑定地址指定为{bind_address, {192,168,0,31}}。如果你传递一个字符串,inets认为它是一个主机名,并尝试解决它,失败了nxdomain