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, <>}