mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
ejabberd_listener: Let module take over socket
For some use cases, it may be necessary to allow a module to take over socket ownership during initialization.
This commit is contained in:
parent
c2cd592eff
commit
e858738736
@ -318,6 +318,9 @@ start_connection(Module, Arity, Socket, State, Sup) ->
|
||||
supervisor:start_child(Sup, [{gen_tcp, Socket}, State])
|
||||
end,
|
||||
case Res of
|
||||
{ok, Pid, preowned_socket} ->
|
||||
Module:accept(Pid),
|
||||
{ok, Pid};
|
||||
{ok, Pid} ->
|
||||
case gen_tcp:controlling_process(Socket, Pid) of
|
||||
ok ->
|
||||
|
Loading…
Reference in New Issue
Block a user