From 5037e0e474044d7fc04092158784395a001e5c25 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 Nov 2021 11:40:49 +0100 Subject: Correctly close RTMPS server too --- server/lib/live/live-manager.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'server/lib/live') diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts index c75cc3bda..1b7b9dd4d 100644 --- a/server/lib/live/live-manager.ts +++ b/server/lib/live/live-manager.ts @@ -150,10 +150,19 @@ class LiveManager { stop () { this.running = false - logger.info('Stopping RTMP server.', lTags()) + if (this.rtmpServer) { + logger.info('Stopping RTMP server.', lTags()) - this.rtmpServer.close() - this.rtmpServer = undefined + this.rtmpServer.close() + this.rtmpServer = undefined + } + + if (this.rtmpsServer) { + logger.info('Stopping RTMPS server.', lTags()) + + this.rtmpsServer.close() + this.rtmpsServer = undefined + } // Sessions is an object this.getContext().sessions.forEach((session: any) => { -- cgit v1.2.3