use emqttd:reg_name/2 to replace name/1

This commit is contained in:
Feng 2016-01-17 19:59:33 +08:00
parent 0a29c8760e
commit 43165a5e8a
1 changed files with 1 additions and 4 deletions

View File

@ -85,10 +85,7 @@ mnesia(copy) ->
%%------------------------------------------------------------------------------ %%------------------------------------------------------------------------------
-spec start_link(atom(), pos_integer()) -> {ok, pid()} | ignore | {error, any()}. -spec start_link(atom(), pos_integer()) -> {ok, pid()} | ignore | {error, any()}.
start_link(Pool, Id) -> start_link(Pool, Id) ->
gen_server2:start_link({local, name(Id)}, ?MODULE, [Pool, Id], []). gen_server2:start_link({local, emqttd:reg_name(?MODULE, Id)}, ?MODULE, [Pool, Id], []).
name(Id) ->
list_to_atom("emqttd_sm_" ++ integer_to_list(Id)).
%%------------------------------------------------------------------------------ %%------------------------------------------------------------------------------
%% @doc Start a session %% @doc Start a session