parent
ed2abe471a
commit
d96ab48c6b
|
@ -280,12 +280,14 @@ udp_recv(Socket, Module, Opts) ->
|
||||||
{ok, pid()} | {error, any()} | ignore.
|
{ok, pid()} | {error, any()} | ignore.
|
||||||
start_connection(Module, Arity, Socket, Opts, Sup) ->
|
start_connection(Module, Arity, Socket, Opts, Sup) ->
|
||||||
Res = case Sup of
|
Res = case Sup of
|
||||||
|
undefined when Arity == 3 ->
|
||||||
|
Module:start(gen_tcp, Socket, Opts);
|
||||||
undefined ->
|
undefined ->
|
||||||
case Arity of
|
Module:start({gen_tcp, Socket}, Opts);
|
||||||
3 -> Module:start(gen_tcp, Socket, Opts);
|
_ when Arity == 3 ->
|
||||||
2 -> Module:start({gen_tcp, Socket}, Opts)
|
supervisor:start_child(Sup, [gen_tcp, Socket, Opts]);
|
||||||
end;
|
_ ->
|
||||||
_ -> supervisor:start_child(Sup, [{gen_tcp, Socket}, Opts])
|
supervisor:start_child(Sup, [{gen_tcp, Socket}, Opts])
|
||||||
end,
|
end,
|
||||||
case Res of
|
case Res of
|
||||||
{ok, Pid} ->
|
{ok, Pid} ->
|
||||||
|
|
Loading…
Reference in New Issue