Skip to content

Commit b927eff

Browse files
committed
reset waitingHeartbeat flag in Close method
Add missing reset of waitingHeartbeat flag when closing the client. This prevents stale state from persisting during reconnection attempts, which was causing abnormal heartbeat behavior after reconnections. Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
1 parent 2ec5682 commit b927eff

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

rtty.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ func (cli *RttyClient) Register() error {
221221

222222
func (cli *RttyClient) Close() {
223223
cli.mu.Lock()
224+
cli.waitingHeartbeat = false
224225
if cli.heartbeatTimer != nil {
225226
cli.heartbeatTimer.Stop()
226227
cli.heartbeatTimer = nil

0 commit comments

Comments
 (0)