Correctly close RTMPS server too

This commit is contained in:
Chocobozzz 2021-11-05 11:40:49 +01:00
parent df1db951c5
commit 5037e0e474
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 14 additions and 3 deletions

View File

@ -386,7 +386,9 @@ live:
rtmps:
enabled: false
port: 1936
# Absolute path
key_file: ''
# Absolute path
cert_file: ''
# Allow to transcode the live streaming in multiple live resolutions

View File

@ -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) => {