Fix received/1 and sent/1 function spec
This commit is contained in:
parent
53145bbbba
commit
e675959d57
|
@ -249,8 +249,6 @@ subscriptions(["add", ClientId, Topic, QoS]) ->
|
|||
case emqttd:subscribe(bin(Topic), bin(ClientId), [{qos, IntQos}]) of
|
||||
ok ->
|
||||
?PRINT_MSG("ok~n");
|
||||
{error, already_existed} ->
|
||||
?PRINT_MSG("Error: already existed~n");
|
||||
{error, Reason} ->
|
||||
?PRINT("Error: ~p~n", [Reason])
|
||||
end
|
||||
|
|
|
@ -102,7 +102,7 @@ start_link() ->
|
|||
gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
|
||||
|
||||
%% @doc Count packets received.
|
||||
-spec(received(mqtt_packet()) -> ok).
|
||||
-spec(received(mqtt_packet()) -> ignore | non_neg_integer()).
|
||||
received(Packet) ->
|
||||
inc('packets/received'),
|
||||
received1(Packet).
|
||||
|
@ -140,7 +140,7 @@ qos_received(?QOS_2) ->
|
|||
inc('messages/qos2/received').
|
||||
|
||||
%% @doc Count packets received. Will not count $SYS PUBLISH.
|
||||
-spec(sent(mqtt_packet()) -> ok).
|
||||
-spec(sent(mqtt_packet()) -> ignore | non_neg_integer()).
|
||||
sent(?PUBLISH_PACKET(_Qos, <<"$SYS/", _/binary>>, _, _)) ->
|
||||
ignore;
|
||||
sent(Packet) ->
|
||||
|
@ -169,7 +169,7 @@ sent2(?UNSUBACK) ->
|
|||
sent2(?PINGRESP) ->
|
||||
inc('packets/pingresp');
|
||||
sent2(_Type) ->
|
||||
ingore.
|
||||
ignore.
|
||||
qos_sent(?QOS_0) ->
|
||||
inc('messages/qos0/sent');
|
||||
qos_sent(?QOS_1) ->
|
||||
|
|
Loading…
Reference in New Issue