From 890f2036097f985e3ab9224d96f9c59a63d14a2b Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Tue, 24 Feb 2026 16:44:48 +0800 Subject: [PATCH] fix ping --- apps/sdlan/src/quic/sdlan_quic_channel.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/sdlan/src/quic/sdlan_quic_channel.erl b/apps/sdlan/src/quic/sdlan_quic_channel.erl index 63644a5..94c4847 100644 --- a/apps/sdlan/src/quic/sdlan_quic_channel.erl +++ b/apps/sdlan/src/quic/sdlan_quic_channel.erl @@ -217,6 +217,7 @@ handle_event(info, {frame, <>}, registered, handle_event(info, {frame, <>}, registered, State = #state{stream = Stream, ping_counter = PingCounter}) -> quic_send(Stream, <>), + logger:debug("[sdlan_quic_channel] get ping"), {keep_state, State#state{ping_counter = PingCounter + 1}}; handle_event(info, {timeout, _, ping_ticker}, _, State = #state{client_id = ClientId, ping_counter = PingCounter}) -> @@ -224,7 +225,7 @@ handle_event(info, {timeout, _, ping_ticker}, _, State = #state{client_id = Clie erlang:start_timer(?PING_TICKER, self(), ping_ticker), case PingCounter > 0 of true -> - {noreply, State#state{ping_counter = 0}}; + {keep_state, State#state{ping_counter = 0}}; false -> logger:debug("[sdlan_channel] client_id: ~p, ping losted", [ClientId]), {stop, normal, State#state{ping_counter = 0}}