SIPSorcery.Net.RTPChannel.Close C# (CSharp) Method

Close() public method

Closes the session's RTP and control ports.
public Close ( ) : void
return void
        public void Close()
        {
            if (!_isClosed)
            {
                try
                {
                    logger.Debug("RTPChannel closing, RTP port " + _rtpPort + ".");

                    _isClosed = true;

                    if (_rtpSocket != null)
                    {
                        _rtpSocket.Close();
                    }

                    if (_controlSocket != null)
                    {
                        _controlSocket.Close();
                    }
                }
                catch (Exception excp)
                {
                    logger.Error("Exception RTChannel.Close. " + excp);
                }
            }
        }

Usage Example

Ejemplo n.º 1
0
        public void Close(string reason)
        {
            if (!m_isClosed)
            {
                var report = GetRtcpReport();
                report.Bye = new RTCPBye(Ssrc, reason);
                SendRtcpReport(report);

                m_isClosed = true;
                m_rtcpReportTimer?.Dispose();
                m_rtpChannel.Close(reason);
            }
        }
All Usage Examples Of SIPSorcery.Net.RTPChannel::Close