문제

I have a problem with one module of ejabberd. It is http_bind. But when I debug deeply I found that after accept socket and spawning hadling process and when reasign process for recieve data for new created process by calling gen_tcp:controlling_process() failed with badarg, WHY?

...

{ok, Socket} = get_tcp:accept(ListenSocket),
Opts = [{active, false}, ...],

% here function return result of proc_lib:spawn_link(handler, ...)
{ok, Pid} = ejabberd_http:start({gen_tcp, Socket}, Opts),

gen_tcp:controlling_process(Socket, Pid),

: {badarg, [
   {erlang, port_connect, [#Port<0.140743856>, <0.5939.4350>]}, 
   {inet, tcp_controlling_process, 2},
   {ejabberd_socket,start,4},
   {ejabberd_listener,accept,3},
   {proc_lib,init_p,5}
]}

any help?

도움이 되었습니까?

해결책

Most probably the socket or the process has crashed before the call to controlling_process.

http://www.erlang.org/doc/man/erlang.html#port_connect-2

Why they would have crashed I don't know, have you made sure that the ejabberd process is running as it should?

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