File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Src/EngineIoClientDotNet.mono/Client Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -567,9 +567,18 @@ private void SetPing()
567567 var log2 = LogManager . GetLogger ( Global . CallerName ( ) ) ;
568568 log2 . Info ( "EasyTimer SetPing start" ) ;
569569
570- Ping ( ) ;
571- OnHeartbeat ( PingTimeout ) ;
572- log2 . Info ( "EasyTimer SetPing finish" ) ;
570+ if ( Upgrading )
571+ {
572+ // skip this ping during upgrade
573+ SetPing ( ) ;
574+ log2 . Info ( "skipping Ping during upgrade" ) ;
575+ }
576+ else
577+ {
578+ Ping ( ) ;
579+ OnHeartbeat ( PingTimeout ) ;
580+ log2 . Info ( "EasyTimer SetPing finish" ) ;
581+ }
573582 } , ( int ) PingInterval ) ;
574583 }
575584
@@ -663,6 +672,11 @@ private Task WaitForUpgrade()
663672 log . Info ( "Wait for upgrade timeout" ) ;
664673 break ;
665674 }
675+ else
676+ {
677+ // yield to another thread
678+ System . Threading . Thread . Yield ( ) ;
679+ }
666680 }
667681 tcs . SetResult ( null ) ;
668682 }
You can’t perform that action at this time.
0 commit comments