emqttd_cm:reg/1, emqttd_cm:unreg/1

This commit is contained in:
Feng Lee 2016-08-10 16:40:36 +08:00
parent 766f74692d
commit 91e96e738d
1 changed files with 3 additions and 3 deletions

View File

@ -149,7 +149,7 @@ process(Packet = ?CONNECT_PACKET(Var), State0) ->
case emqttd_sm:start_session(CleanSess, clientid(State2)) of case emqttd_sm:start_session(CleanSess, clientid(State2)) of
{ok, Session, SP} -> {ok, Session, SP} ->
%% Register the client %% Register the client
emqttd_cm:register(client(State2)), emqttd_cm:reg(client(State2)),
%% Start keepalive %% Start keepalive
start_keepalive(KeepAlive), start_keepalive(KeepAlive),
%% ACCEPT %% ACCEPT
@ -277,7 +277,7 @@ shutdown(_Error, #proto_state{client_id = undefined}) ->
shutdown(conflict, #proto_state{client_id = _ClientId}) -> shutdown(conflict, #proto_state{client_id = _ClientId}) ->
%% let it down %% let it down
%% emqttd_cm:unregister(ClientId); %% emqttd_cm:unreg(ClientId);
ignore; ignore;
shutdown(Error, State = #proto_state{client_id = ClientId, will_msg = WillMsg}) -> shutdown(Error, State = #proto_state{client_id = ClientId, will_msg = WillMsg}) ->
@ -285,7 +285,7 @@ shutdown(Error, State = #proto_state{client_id = ClientId, will_msg = WillMsg})
send_willmsg(ClientId, WillMsg), send_willmsg(ClientId, WillMsg),
emqttd:run_hooks('client.disconnected', [Error], ClientId), emqttd:run_hooks('client.disconnected', [Error], ClientId),
%% let it down %% let it down
%% emqttd_cm:unregister(ClientId). %% emqttd_cm:unreg(ClientId).
ok. ok.
willmsg(Packet) when is_record(Packet, mqtt_packet_connect) -> willmsg(Packet) when is_record(Packet, mqtt_packet_connect) ->