Просмотр исходного кода

feat(emqx_connection): async_set_keepalive defaults to self()

Zaiming Shi 4 лет назад
Родитель
Сommit
1e2bd2610f
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      src/emqx_connection.erl

+ 5 - 1
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, <<Idle:32/native>>}