shutdown...

This commit is contained in:
Feng Lee 2015-05-26 13:21:55 +08:00
parent 4d00487f86
commit 07b9cfa722
1 changed files with 3 additions and 3 deletions

View File

@ -161,15 +161,15 @@ handle_info(Info, State = #state{peername = Peername}) ->
{stop, {badinfo, Info}, State}.
terminate(Reason, #state{peername = Peername, keepalive = KeepAlive, proto_state = ProtoState}) ->
lager:debug("Client ~s: ~p terminated, reason: ~p~n", [emqttd_net:format(Peername), self(), Reason]),
lager:info("Client ~s: ~p terminated, reason: ~p~n", [emqttd_net:format(Peername), self(), Reason]),
notify(disconnected, Reason, ProtoState),
emqttd_keepalive:cancel(KeepAlive),
case {ProtoState, Reason} of
{undefined, _} -> ok;
{_, {shutdown, Error}} ->
emqttd_protocol:shutdown(Error, ProtoState);
{_, _} ->
ok
{_, Reason} ->
emqttd_protocol:shutdown(Reason, ProtoState)
end.
code_change(_OldVsn, State, _Extra) ->