SIPSorcery.Net.RTSPClient.Teardown C# (CSharp) Méthode

Teardown() private méthode

Sends the RTSP teardown request for an existing RTSP session.
private Teardown ( ) : void
Résultat void
        private void Teardown()
        {
            try
            {
                if (_rtspStream != null && _rtspConnection.Connected)
                {
                    logger.Debug("RTSP client sending teardown request for " + _url + ".");

                    RTSPRequest teardownRequest = new RTSPRequest(RTSPMethodsEnum.TEARDOWN, _url);
                    RTSPHeader teardownHeader = new RTSPHeader(_cseq++, _rtspSession.SessionID);
                    teardownRequest.Header = teardownHeader;

                    System.Diagnostics.Debug.WriteLine(teardownRequest.ToString());

                    var buffer = Encoding.UTF8.GetBytes(teardownRequest.ToString());
                    _rtspStream.Write(buffer, 0, buffer.Length);
                }
                else
                {
                    logger.Debug("RTSP client did not send teardown request for " + _url + ", the socket was closed.");
                }
            }
            catch (Exception excp)
            {
                logger.Error("Exception RTSPClient.Teardown. " + excp);
            }
        }