你好,
我有个关于 inets 的基础问题(顺便说一下,它不需要额外依赖,用着很方便),已经启动的 inets“服务”该怎么关闭(比如在 28.4 版本中)?
下面这些尝试都没成功。
Eshell V16.3 (press Ctrl+G to abort, type help(). for help)
(demo@nodebox)1> inets:start().
ok
(demo@nodebox)2> {ok,ServerPid} = inets:start( httpd,[{profile,cedar}, {port,8080}, {server_name,"maple"}, {server_root,"."}, {document_root,"."}, {bind_address,"127.0.0.1"}]).
{ok,<0.115.0>}
(demo@nodebox)3> inets:stop( httpd, ServerPid).
{error,not_found}
(demo@nodebox)4> inets:stop( httpd, cedar).
** exception error: no function clause matching httpd:stop_service(cedar) (httpd.erl:1278)
in function inets:call_service/3 (inets.erl:558)
(demo@nodebox)5> inets:stop( httpd, "maple").
** exception error: no function clause matching httpd:stop_service("maple") (httpd.erl:1278)
in function inets:call_service/3 (inets.erl:558)
(demo@nodebox)7> inets:services().
[{httpc,<0.111.0>},{httpd,<0.115.0>}]
(demo@nodebox)8> ServerPid.
<0.115.0>
(demo@nodebox)9> inets:services_info().
[{httpc,<0.111.0>,[{profile,default}]},
{httpd,<0.115.0>,
[{bind_address,{127,0,0,1}},
{host,"nodebox"},
{port,8080},
{server_name,"maple"}]}]
上面的 httpd 条目是不是因为什么原因少了 {profile,cedar}?
希望能得到一些提示,谢谢!
Tavin.
从英语翻译·查看原文Hello,
I've got a fairly elementary question about inets (which, incidentally, I find quite handy because it needs no additional dependency): how do we shut down an inets “service” we've launched (say, on version 28.4)?
The attempts below didn't succeed:
Eshell V16.3 (press Ctrl+G to abort, type help(). for help)
(demo@nodebox)1> inets:start().
ok
(demo@nodebox)2> {ok,ServerPid} = inets:start( httpd,[{profile,cedar}, {port,8080}, {server_name,"maple"}, {server_root,"."}, {document_root,"."}, {bind_address,"127.0.0.1"}]).
{ok,<0.115.0>}
(demo@nodebox)3> inets:stop( httpd, ServerPid).
{error,not_found}
(demo@nodebox)4> inets:stop( httpd, cedar).
** exception error: no function clause matching httpd:stop_service(cedar) (httpd.erl:1278)
in function inets:call_service/3 (inets.erl:558)
(demo@nodebox)5> inets:stop( httpd, "maple").
** exception error: no function clause matching httpd:stop_service("maple") (httpd.erl:1278)
in function inets:call_service/3 (inets.erl:558)
(demo@nodebox)7> inets:services().
[{httpc,<0.111.0>},{httpd,<0.115.0>}]
(demo@nodebox)8> ServerPid.
<0.115.0>
(demo@nodebox)9> inets:services_info().
[{httpc,<0.111.0>,[{profile,default}]},
{httpd,<0.115.0>,
[{bind_address,{127,0,0,1}},
{host,"nodebox"},
{port,8080},
{server_name,"maple"}]}]
Could the httpd entry shown above somehow be missing a {profile,cedar}?
I'd appreciate any pointers, thanks!
Tavin.