From 6e05b2202dd3a82127d8f49d4e32537b762e6f70 Mon Sep 17 00:00:00 2001 From: "milkywayrivers@gmail.com" Date: Sat, 16 Mar 2019 15:04:12 +0800 Subject: [PATCH] close UDP connection when RTSPClient Stop --- rtsp/rtsp-client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtsp/rtsp-client.go b/rtsp/rtsp-client.go index d6189f2f..29711419 100644 --- a/rtsp/rtsp-client.go +++ b/rtsp/rtsp-client.go @@ -501,6 +501,10 @@ func (client *RTSPClient) Stop() { client.Conn.Close() client.Conn = nil } + if client.UDPServer != nil{ + client.UDPServer.Stop() + client.UDPServer = nil + } } func (client *RTSPClient) RequestWithPath(method string, path string, headers map[string]string, needResp bool) (resp *Response, err error) {