Get rid of a workaround against old Erlang bug

This commit is contained in:
Evgeniy Khramtsov 2017-05-21 13:30:46 +03:00
parent 470669fa6b
commit 0a77b9f43e
1 changed files with 8 additions and 10 deletions

View File

@ -248,17 +248,15 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}.
activate_socket(#state{socket = Socket,
sock_mod = SockMod}) ->
PeerName = case SockMod of
gen_tcp ->
inet:setopts(Socket, [{active, once}]),
inet:peername(Socket);
_ ->
SockMod:setopts(Socket, [{active, once}]),
SockMod:peername(Socket)
end,
case PeerName of
Res = case SockMod of
gen_tcp ->
inet:setopts(Socket, [{active, once}]);
_ ->
SockMod:setopts(Socket, [{active, once}])
end,
case Res of
{error, _Reason} -> self() ! {tcp_closed, Socket};
{ok, _} -> ok
ok -> ok
end.
%% Data processing for connectors directly generating xmlelement in