From c7979efb07dc54ce0d525127059c239bf9822fa0 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 21 Sep 2023 15:09:19 +0200 Subject: [PATCH] Cancel SRT/RTMP session immediately on disconnect --- rtmp/channel.go | 1 + srt/channel.go | 1 + 2 files changed, 2 insertions(+) diff --git a/rtmp/channel.go b/rtmp/channel.go index 666dca83..e471c1ca 100644 --- a/rtmp/channel.go +++ b/rtmp/channel.go @@ -66,6 +66,7 @@ func (c *client) ticker(ctx context.Context) { func (c *client) Close() { c.cancel() c.conn.Close() + c.collector.Close(c.id) } // channel represents a stream that is sent to the server diff --git a/srt/channel.go b/srt/channel.go index ee2fbad9..1f7fc3a6 100644 --- a/srt/channel.go +++ b/srt/channel.go @@ -68,6 +68,7 @@ func (c *client) ticker(ctx context.Context) { func (c *client) Close() { c.cancel() c.conn.Close() + c.collector.Close(c.id) } // channel represents a stream that is sent to the server