File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,11 @@ public class RTCPSession
9191 /// </summary>
9292 public DateTime LastActivityAt { get ; private set ; } = DateTime . MinValue ;
9393
94+ /// <summary>
95+ /// Time to wait before classifying the session as timed out due to inactivity.
96+ /// </summary>
97+ public TimeSpan NoActivityTimeout { get ; private set ; } = new ( ticks : NO_ACTIVITY_TIMEOUT_MILLISECONDS * TimeSpan . TicksPerMillisecond ) ;
98+
9499 /// <summary>
95100 /// Indicates whether the session is currently in a timed out state. This
96101 /// occurs if no RTP or RTCP packets have been received during an expected
@@ -313,8 +318,8 @@ private void SendReportTimerCallback(Object stateInfo)
313318 {
314319 lock ( m_rtcpReportTimer )
315320 {
316- if ( ( LastActivityAt != DateTime . MinValue && DateTime . Now . Subtract ( LastActivityAt ) . TotalMilliseconds > NO_ACTIVITY_TIMEOUT_MILLISECONDS ) ||
317- ( LastActivityAt == DateTime . MinValue && DateTime . Now . Subtract ( CreatedAt ) . TotalMilliseconds > NO_ACTIVITY_TIMEOUT_MILLISECONDS ) )
321+ if ( ( LastActivityAt != DateTime . MinValue && DateTime . Now . Subtract ( LastActivityAt ) > NoActivityTimeout ) ||
322+ ( LastActivityAt == DateTime . MinValue && DateTime . Now . Subtract ( CreatedAt ) > NoActivityTimeout ) )
318323 {
319324 if ( ! IsTimedOut )
320325 {
You can’t perform that action at this time.
0 commit comments