mirror of
https://github.com/chuot/rdio-scanner.git
synced 2026-08-13 16:33:01 -06:00
Remove webapp custom keepalive
This commit is contained in:
parent
0096335ac2
commit
b78a0e1ebf
|
|
@ -84,7 +84,6 @@ export class AppRdioScannerService implements OnDestroy {
|
||||||
private skipDelay: number | undefined;
|
private skipDelay: number | undefined;
|
||||||
|
|
||||||
private webSocket: WebSocket | undefined;
|
private webSocket: WebSocket | undefined;
|
||||||
private webSocketHeartBeat = 30 * 1000;
|
|
||||||
private webSocketInterval: number | undefined;
|
private webSocketInterval: number | undefined;
|
||||||
private webSocketTimeout: number | undefined;
|
private webSocketTimeout: number | undefined;
|
||||||
private webSocketPendingMessage = false;
|
private webSocketPendingMessage = false;
|
||||||
|
|
@ -632,8 +631,6 @@ export class AppRdioScannerService implements OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(message)) {
|
if (Array.isArray(message)) {
|
||||||
this.webSocketKeepAlive();
|
|
||||||
|
|
||||||
this.webSocketPendingMessage = false;
|
this.webSocketPendingMessage = false;
|
||||||
|
|
||||||
switch (message[0]) {
|
switch (message[0]) {
|
||||||
|
|
@ -735,25 +732,6 @@ export class AppRdioScannerService implements OnDestroy {
|
||||||
|
|
||||||
this.webSocketInterval = undefined;
|
this.webSocketInterval = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private webSocketKeepAlive(): void {
|
|
||||||
if (this.webSocketTimeout) {
|
|
||||||
clearTimeout(this.webSocketTimeout);
|
|
||||||
|
|
||||||
this.webSocketTimeout = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.webSocketInterval) {
|
|
||||||
clearInterval(this.webSocketInterval);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.webSocketInterval = setInterval(() => {
|
|
||||||
this.webSocketSend(WebSocketCommand.Nop);
|
|
||||||
|
|
||||||
this.webSocketTimeout = setTimeout(() => this.webSocketReconnect(), 10 * 1000);
|
|
||||||
}, this.webSocketHeartBeat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private webSocketOpen(): void {
|
private webSocketOpen(): void {
|
||||||
|
|
@ -770,8 +748,6 @@ export class AppRdioScannerService implements OnDestroy {
|
||||||
this.webSocket.onmessage = (ev: MessageEvent) => this.messageParser(ev.data);
|
this.webSocket.onmessage = (ev: MessageEvent) => this.messageParser(ev.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.webSocketKeepAlive();
|
|
||||||
|
|
||||||
this.webSocketSend(WebSocketCommand.Config);
|
this.webSocketSend(WebSocketCommand.Config);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue