Здравствуйте,
У меня довольно простой вопрос об 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.