From f2d030cdc77875eaa996c33aa30ef1c42bd9645b Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Tue, 31 Aug 2021 00:23:22 +0530 Subject: [PATCH] Socket Fixed --- play-dl/YouTube/classes/LiveStream.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/play-dl/YouTube/classes/LiveStream.ts b/play-dl/YouTube/classes/LiveStream.ts index 85cee36..2aa97dd 100644 --- a/play-dl/YouTube/classes/LiveStream.ts +++ b/play-dl/YouTube/classes/LiveStream.ts @@ -183,10 +183,8 @@ export class Stream { private cleanup(){ clearTimeout(this.timer as NodeJS.Timer) - this.socket?.end() - this.socket?.on('close', () => { - console.log('Socket Closed') - }) + this.socket?.destroy() + this.socket = null this.timer = null this.url = '' this.bytes_count = 0