fix issue #535
This commit is contained in:
parent
18b8e8195f
commit
f5adafe9e2
|
@ -79,11 +79,12 @@ init([OriginConn, MqttEnv]) ->
|
|||
exit({shutdown, Reason})
|
||||
end,
|
||||
ConnName = esockd_net:format(PeerName),
|
||||
Self = self(),
|
||||
SendFun = fun(Data) ->
|
||||
try Connection:async_send(Data) of
|
||||
true -> ok
|
||||
catch
|
||||
error:Error -> exit({shutdown, Error})
|
||||
error:Error -> Self ! {shutdown, Error}
|
||||
end
|
||||
end,
|
||||
PktOpts = proplists:get_value(packet, MqttEnv),
|
||||
|
@ -138,6 +139,10 @@ handle_cast(Msg, State) ->
|
|||
handle_info(timeout, State) ->
|
||||
shutdown(idle_timeout, State);
|
||||
|
||||
%% fix issue #535
|
||||
handle_info({shutdown, Error}, State) ->
|
||||
shutdown(Error, State);
|
||||
|
||||
%% Asynchronous SUBACK
|
||||
handle_info({suback, PacketId, GrantedQos}, State) ->
|
||||
with_proto_state(fun(ProtoState) ->
|
||||
|
|
Loading…
Reference in New Issue