Handle ignore from xmpp_socket callback start

This should help with issue #2244
This commit is contained in:
Paweł Chmielowski 2018-01-24 17:32:09 +01:00
parent 666da60cba
commit 56d4224e08
1 changed files with 6 additions and 2 deletions

View File

@ -117,9 +117,13 @@ start(Module, SockMod, Socket, Opts) ->
ok = SockMod:controlling_process(Socket, Pid),
{ok, Pid}
end
catch _:{badmatch, {error, _} = Err} ->
catch
_:{badmatch, {error, _} = Err} ->
SockMod:close(Socket),
Err
Err;
_:{badmatch, ignore} ->
SockMod:close(Socket),
ignore
end.
connect(Addr, Port, Opts) ->