Exemple #1
0
        private void RTSP_ProcessTeardownRequest(RtspRequestTeardown message, RtspListener listener)
        {
            if (message.Session == _videoSessionId) // SHOULD HAVE AN AUDIO TEARDOWN AS WELL
            {
                // If this is UDP, close the transport
                // For TCP there is no transport to close (as RTP packets were interleaved into the RTSP connection)

                Rtsp.Messages.RtspResponse teardown_response = message.CreateResponse(_logger);
                listener.SendMessage(teardown_response);

                CloseConnection("teardown");
            }
        }
        internal RtspResponse HandleTeardown(RtspRequestTeardown request)
        {
            Contract.Requires(request != null);
            Contract.Ensures(Contract.Result <RtspResponse>() != null);


            var response = request.CreateResponse();
            RtspPushDescription description;

            if (!PushDescriptions.TryGetValue(request.RtspUri.AbsolutePath, out description))
            {
                response.ReturnCode = 404;
                return(response);
            }

            description.Stop(request.Session);



            return(response);
        }