From 467c6307f69aabce2b485bec16ac940fb6f208ed Mon Sep 17 00:00:00 2001 From: Feng Date: Tue, 15 Mar 2016 00:58:35 +0800 Subject: [PATCH] keepalive * 1.25 --- src/emqttd_protocol.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emqttd_protocol.erl b/src/emqttd_protocol.erl index 4888c27a1..c8fc4fe73 100644 --- a/src/emqttd_protocol.erl +++ b/src/emqttd_protocol.erl @@ -303,13 +303,13 @@ maybe_set_clientid(State) -> send_willmsg(_ClientId, undefined) -> ignore; -send_willmsg(ClientId, WillMsg) -> +send_willmsg(ClientId, WillMsg) -> emqttd:publish(WillMsg#mqtt_message{from = ClientId}). start_keepalive(0) -> ignore; start_keepalive(Sec) when Sec > 0 -> - self() ! {keepalive, start, Sec}. + self() ! {keepalive, start, round(Sec * 1.25)}. %%-------------------------------------------------------------------- %% Validate Packets