fix(virtualstream): Fix keep-alive loop handling and test cleanup

This commit is contained in:
2024-09-06 13:46:09 +02:00
parent f461f16bfd
commit 4d98915dbd
4 changed files with 14 additions and 3 deletions
+4
View File
@@ -295,7 +295,11 @@ export class VirtualStream<T = Uint8Array> implements plugins.typedRequestInterf
*/
private async startKeepAliveLoop() {
// initially wait for a second
if (this.side === 'responding') {
return;
}
await plugins.smartdelay.delayFor(0);
console.log(`starting keepalive loop on side ${this.side}`);
let counter = 0;
keepAliveLoop: while (this.keepAlive) {
await this.triggerKeepAlive();