/// <summary> /// Clean up the RtcpListener /// /// A thread will not abort until it is in the running state. Our listening thread is /// generally blocked by the call to rtcpNetworkListener.ReceiveFrom(). In order to /// dispose things quickly and efficiently, we tell the listening thread to abort as soon /// as it is back in the running state. Then we clean up the network listener which should /// unblock us. /// </summary> /// <param name="disposing"></param> private void Dispose(bool disposing) { lock(this) { disposed = true; threadRtcpListener.Abort(); threadRtcpListener = null; rtcpNetworkListener.Dispose(); rtcpNetworkListener = null; } }
private void DisposeNetwork() { rtpNetworkListener.Dispose(); rtpNetworkListener = null; }
private void Initialize() { rtcpNetworkListener = new UdpReceiver(rtpSession.RtcpEndPoint, RtpSession.DefaultNetworkTimeout * 2); threadRtcpListener = new Thread(new ThreadStart(ListenThread)); threadRtcpListener.IsBackground = true; threadRtcpListener.Name = "RtcpListener"; threadRtcpListener.Start(); }
private void InitializeNetwork() { rtpNetworkListener = new UdpReceiver(rtpSession.RtpEndPoint, RtpSession.DefaultNetworkTimeout); }