Beispiel #1
0
        /// <summary>
        /// Close the session and RTP channel.
        /// </summary>
        public void CloseSession(string reason)
        {
            if (!m_isClosed)
            {
                m_isClosed = true;

                m_audioRtcpSession?.Close(reason);
                m_videoRtcpSession?.Close(reason);

                if (RtpChannel != null)
                {
                    RtpChannel.OnRTPDataReceived     -= OnReceive;
                    RtpChannel.OnControlDataReceived -= OnReceive;
                    RtpChannel.OnClosed -= OnRTPChannelClosed;
                    RtpChannel.Close(reason);
                }

                OnRtpClosed?.Invoke(reason);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Close the session and RTP channel.
        /// </summary>
        public void CloseSession(string reason)
        {
            if (!m_isClosed)
            {
                m_isClosed = true;

                OnRtpPacketReceived -= RtcpSession.RtpPacketReceived;
                OnRtpPacketSent     -= RtcpSession.RtpPacketSent;
                RtcpSession.Close(reason);

                if (RtpChannel != null)
                {
                    RtpChannel.OnRTPDataReceived     -= RtpPacketReceived;
                    RtpChannel.OnClosed              -= OnRTPChannelClosed;
                    RtpChannel.OnControlDataReceived -= RtcpSession.ControlDataReceived;
                    RtpChannel.Close(reason);
                }

                OnRtpClosed?.Invoke(reason);
            }
        }