dump keepalive
This commit is contained in:
parent
5d6a70afb2
commit
2deed75c26
|
@ -115,14 +115,14 @@ handle_info({inet_reply, _Sock, {error, Reason}}, State) ->
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
handle_info({keepalive, start, TimeoutSec}, State = #state{socket = Socket}) ->
|
handle_info({keepalive, start, TimeoutSec}, State = #state{socket = Socket}) ->
|
||||||
lager:info("~s keepalive started: ~p", [State#state.peer_name, TimeoutSec]),
|
lager:info("Client: ~s: Start KeepAlive with ~p seconds", [State#state.peer_name, TimeoutSec]),
|
||||||
KeepAlive = emqtt_keepalive:new(Socket, TimeoutSec, {keepalive, timeout}),
|
KeepAlive = emqtt_keepalive:new(Socket, TimeoutSec, {keepalive, timeout}),
|
||||||
{noreply, State#state{ keepalive = KeepAlive }};
|
{noreply, State#state{ keepalive = KeepAlive }};
|
||||||
|
|
||||||
handle_info({keepalive, timeout}, State = #state { keepalive = KeepAlive }) ->
|
handle_info({keepalive, timeout}, State = #state { keepalive = KeepAlive }) ->
|
||||||
case emqtt_keepalive:resume(KeepAlive) of
|
case emqtt_keepalive:resume(KeepAlive) of
|
||||||
timeout ->
|
timeout ->
|
||||||
lager:info("~s keepalive timeout!", [State#state.peer_name]),
|
lager:info("Client ~s: Keepalive Timeout!", [State#state.peer_name]),
|
||||||
{stop, normal, State};
|
{stop, normal, State};
|
||||||
{resumed, KeepAlive1} ->
|
{resumed, KeepAlive1} ->
|
||||||
lager:info("~s keepalive resumed.", [State#state.peer_name]),
|
lager:info("~s keepalive resumed.", [State#state.peer_name]),
|
||||||
|
|
Loading…
Reference in New Issue