From 1e2bd2610f380d036b171c1447fa253166ce54b4 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Wed, 26 May 2021 12:26:53 +0200 Subject: [PATCH] feat(emqx_connection): async_set_keepalive defaults to self() --- src/emqx_connection.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/emqx_connection.erl b/src/emqx_connection.erl index 814fd9007..0e897f0b3 100644 --- a/src/emqx_connection.erl +++ b/src/emqx_connection.erl @@ -41,7 +41,8 @@ , stats/1 ]). --export([ async_set_keepalive/4 +-export([ async_set_keepalive/3 + , async_set_keepalive/4 , async_set_socket_options/2 ]). @@ -200,6 +201,9 @@ stats(#state{transport = Transport, %% %% NOTE: This API sets TCP socket options, which has nothing to do with %% the MQTT layer's keepalive (PINGREQ and PINGRESP). +async_set_keepalive(Idle, Interval, Probes) -> + async_set_keepalive(self(), Idle, Interval, Probes). + async_set_keepalive(Pid, Idle, Interval, Probes) -> Options = [ {keepalive, true} , {raw, 6, 4, <>}