File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -173,18 +173,17 @@ export class GobanSocket<
173173 this . socket = this . connect ( ) ;
174174
175175 this . on ( "net/pong" , ( { client, server } : { client : number ; server : number } ) => {
176- if ( this . timeout_timer ) {
177- clearTimeout ( this . timeout_timer ) ;
178- this . timeout_timer = undefined ;
179- }
180-
181176 // Ignore pongs from background pings: either we're still in
182177 // background mode, or this is a stale pong that arrived after
183178 // returning to the foreground.
184179 if (
185180 this . options . background_pinging ||
186181 ( this . options . ignore_pongs_before && client < this . options . ignore_pongs_before )
187182 ) {
183+ if ( this . timeout_timer ) {
184+ clearTimeout ( this . timeout_timer ) ;
185+ this . timeout_timer = undefined ;
186+ }
188187 return ;
189188 }
190189
@@ -194,6 +193,10 @@ export class GobanSocket<
194193 this . latency = latency ;
195194 this . clock_drift = drift ;
196195 this . emit ( "latency" , latency , drift ) ;
196+ if ( this . timeout_timer ) {
197+ clearTimeout ( this . timeout_timer ) ;
198+ this . timeout_timer = undefined ;
199+ }
197200 } ) ;
198201 }
199202
You can’t perform that action at this time.
0 commit comments