안녕하세요,
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.