Skip to content

Commit 99022cc

Browse files
author
Hubert Plociniczak
committed
Notify the Heartbeat thread when any frame is
received, not only when hearbeat frame comes.
1 parent 8d09341 commit 99022cc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/client/impl/ConnectionBase.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,13 +539,12 @@ public void HeartbeatReadLoop()
539539
FinishClose();
540540
}
541541

542-
public void HandleHeartbeatFrame()
542+
public void NotifyHearbeatThread()
543543
{
544544
if (m_heartbeat == 0) {
545545
// Heartbeating not enabled for this connection.
546546
return;
547547
}
548-
549548
m_heartbeatRead.Set();
550549
}
551550

@@ -601,11 +600,11 @@ public void MainLoopIteration()
601600
{
602601
Frame frame = m_frameHandler.ReadFrame();
603602

603+
NotifyHearbeatThread();
604604
// We have received an actual frame.
605605
if (frame.Type == CommonFraming.Constants.FrameHeartbeat) {
606606
// Ignore it: we've already just reset the heartbeat
607607
// counter.
608-
HandleHeartbeatFrame();
609608
return;
610609
}
611610

0 commit comments

Comments
 (0)