/// <summary> /// <see cref="IRtspSessionManager.TearDownSession(string)"/> /// </summary> /// <param name="sessionId"></param> /// <returns></returns> public bool TearDownSession(string sessionId) { if (_sessions.ContainsKey(sessionId)) { IRtspSession session = null; if (_sessions.TryRemove(sessionId, out session)) { LOG.Debug($"Tearing down RTSP session '{sessionId}'"); session.Stop(); } return(true); } return(false); }
/// <summary> /// <see cref="IRtspSessionManager.RegisterSession(IRtspSession)"/> /// </summary> /// <param name="session"></param> /// <returns></returns> public bool RegisterSession(IRtspSession session) { LOG.Debug($"Registering new RTSP session '{session.Id}' of type '{session.GetType().Name}'"); return(_sessions.TryAdd(session.Id, session)); }