feat(emqx_connection): async_set_keepalive defaults to self()

This commit is contained in:
Zaiming Shi 2021-05-26 12:26:53 +02:00 committed by Rory Z
parent ead084aa68
commit 1e2bd2610f
1 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,8 @@
, stats/1 , stats/1
]). ]).
-export([ async_set_keepalive/4 -export([ async_set_keepalive/3
, async_set_keepalive/4
, async_set_socket_options/2 , 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 %% NOTE: This API sets TCP socket options, which has nothing to do with
%% the MQTT layer's keepalive (PINGREQ and PINGRESP). %% 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) -> async_set_keepalive(Pid, Idle, Interval, Probes) ->
Options = [ {keepalive, true} Options = [ {keepalive, true}
, {raw, 6, 4, <<Idle:32/native>>} , {raw, 6, 4, <<Idle:32/native>>}