chore: close keepalive timeout channel
This commit is contained in:
parent
7d3ea85ef3
commit
8186e9e47a
|
@ -275,7 +275,9 @@ handle_timeout(_TRef, {keepalive, StatVal},
|
||||||
{error, timeout} ->
|
{error, timeout} ->
|
||||||
Req = #{type => 'KEEPALIVE'},
|
Req = #{type => 'KEEPALIVE'},
|
||||||
NChannel = clean_timer(alive_timer, Channel),
|
NChannel = clean_timer(alive_timer, Channel),
|
||||||
{ok, try_dispatch(on_timer_timeout, wrap(Req), NChannel)}
|
%% close connection if keepalive timeout
|
||||||
|
Replies = [{event, disconnected}, {close, normal}],
|
||||||
|
{ok, Replies, try_dispatch(on_timer_timeout, wrap(Req), NChannel)}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
handle_timeout(_TRef, force_close, Channel = #channel{closed_reason = Reason}) ->
|
handle_timeout(_TRef, force_close, Channel = #channel{closed_reason = Reason}) ->
|
||||||
|
|
Loading…
Reference in New Issue