Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/SignalR/clients/ts/signalr/src/HubConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,12 @@ export class HubConnection {
{
let nextPing = this._nextKeepAlive - new Date().getTime();
if (nextPing < 0) {
nextPing = 0;
if (this._connectionState === HubConnectionState.Connected) {
this._sendMessage(this._cachedPingMessage).catch((e) => {
this._logger.log(LogLevel.Warning, "Error sending keep-alive message" + e);
});
return;
}
}

// The timer needs to be set from a networking callback to avoid Chrome timer throttling from causing timers to run once a minute
Expand Down
Loading