Skip to content

Commit

Permalink
Don't keep reseting the ping interval every time, remember that we ch…
Browse files Browse the repository at this point in the history
…anged it.
  • Loading branch information
GreenAsJade committed Oct 3, 2023
1 parent e42a1e0 commit e7d5d1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/GobanSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ export class GobanSocket<
drift: this.clock_drift,
latency: this.latency,
} as DataArgument<SendProtocol["net/ping"]>);

if (this.options.timeout_delay) {
this.timeout_timer = setTimeout(this.signalTimeout, this.options.timeout_delay);
}

if (
this.options.ping_interval &&
this.options.ping_interval !== this.current_ping_interval
Expand All @@ -176,6 +178,7 @@ export class GobanSocket<
this.ping,
this.options.ping_interval || DEFAULT_PING_INTERVAL,
);
this.current_ping_interval = this.options.ping_interval;
}
} else {
if (this.ping_timer) {
Expand Down

0 comments on commit e7d5d1c

Please sign in to comment.