Skip to content

Commit

Permalink
Merge pull request #132 from GreenAsJade/bugfix_only_reset_ping_inter…
Browse files Browse the repository at this point in the history
…val_once

Don't keep reseting the ping interval to a custom value every time...
  • Loading branch information
anoek authored Oct 3, 2023
2 parents e42a1e0 + e7d5d1c commit acb966f
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 acb966f

Please sign in to comment.