Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/app/Media/Sources/AudioExtrasSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ public void SetSource(AudioSourceOptions sourceOptions)
}
else if (_audioOpts.AudioSource == AudioSourcesEnum.Silence)
{
_sendSampleTimer = new Timer(SendSilenceSample, null, 0, _audioSamplePeriodMilliseconds);
_sendSampleTimer = new Timer(SendSilenceSample);
_sendSampleTimer.Change(0, _audioSamplePeriodMilliseconds);
}
else if (_audioOpts.AudioSource == AudioSourcesEnum.PinkNoise ||
_audioOpts.AudioSource == AudioSourcesEnum.WhiteNoise ||
Expand All @@ -344,7 +345,8 @@ public void SetSource(AudioSourceOptions sourceOptions)
break;
}

_sendSampleTimer = new Timer(SendSignalGeneratorSample, null, 0, _audioSamplePeriodMilliseconds);
_sendSampleTimer = new Timer(SendSignalGeneratorSample);
_sendSampleTimer.Change(0, _audioSamplePeriodMilliseconds);
}
else if (_audioOpts.AudioSource == AudioSourcesEnum.Music)
{
Expand All @@ -365,7 +367,8 @@ public void SetSource(AudioSourceOptions sourceOptions)
_musicStreamReader = new BinaryReader(new FileStream(_audioOpts.MusicFile, FileMode.Open, FileAccess.Read));
}

_sendSampleTimer = new Timer(SendMusicSample, null, 0, _audioSamplePeriodMilliseconds);
_sendSampleTimer = new Timer(SendMusicSample);
_sendSampleTimer.Change(0, _audioSamplePeriodMilliseconds);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/app/SIPUserAgents/SIPRegistrationUserAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,13 @@ public void Start()

if (callbackPeriod < REGISTER_MINIMUM_EXPIRY * 1000)
{
m_registrationTimer = new Timer(DoRegistration, null, 0, REGISTER_MINIMUM_EXPIRY * 1000);
m_registrationTimer = new Timer(DoRegistration);
m_registrationTimer.Change(0, REGISTER_MINIMUM_EXPIRY * 1000);
}
else
{
m_registrationTimer = new Timer(DoRegistration, null, 0, callbackPeriod);
m_registrationTimer = new Timer(DoRegistration);
m_registrationTimer.Change(0, callbackPeriod);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/app/SIPUserAgents/SIPUserAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ public async Task InitiateCallAsync(SIPCallDescriptor sipCallDescriptor, IMediaS
if (ringTimeout > 0)
{
logger.LogDebug("Setting ring timeout of {RingTimeout}s.", ringTimeout);
_ringTimeout = new Timer((state) => m_uac?.Cancel(), null, ringTimeout * 1000, Timeout.Infinite);
_ringTimeout = new Timer((state) => m_uac?.Cancel());
_ringTimeout.Change(ringTimeout * 1000, Timeout.Infinite);
}

// This initiates the call but does not wait for an answer.
Expand Down
9 changes: 6 additions & 3 deletions src/net/ICE/RtpIceChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,8 @@ public void StartGathering()

if (_iceServerResolver.IceServers?.Count > 0)
{
_processIceServersTimer = new Timer(CheckIceServers, null, 0, Ta);
_processIceServersTimer = new Timer(CheckIceServers);
_processIceServersTimer.Change(0, Ta);
}
else
{
Expand All @@ -754,7 +755,8 @@ public void StartGathering()
OnIceGatheringStateChange?.Invoke(IceGatheringState);
}

_connectivityChecksTimer = new Timer(DoConnectivityCheck, null, 0, Ta);
_connectivityChecksTimer = new Timer(DoConnectivityCheck);
_connectivityChecksTimer.Change(0, Ta);
}
}

Expand Down Expand Up @@ -1111,7 +1113,8 @@ private void CheckIceServers(Object state)
{
logger.LogDebug("ICE RTP channel stopping ICE server checks in gathering state {IceGatheringState} and connection state {IceConnectionState}.", IceGatheringState, IceConnectionState);
_refreshTurnTimer?.Dispose();
_refreshTurnTimer = new Timer(RefreshTurn, null, 0, 2000);
_refreshTurnTimer = new Timer(RefreshTurn);
_refreshTurnTimer.Change(0, 2000);
_processIceServersTimer.Dispose();
return;
}
Expand Down
6 changes: 4 additions & 2 deletions src/net/RTCP/RTCPSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ public void Start()

// Schedule an immediate sender report.
var interval = GetNextRtcpInterval(RTCP_MINIMUM_REPORT_PERIOD_MILLISECONDS);
m_rtcpReportTimer = new Timer(SendReportTimerCallback, null, interval, Timeout.Infinite);
m_rtcpReportTimer = new Timer(SendReportTimerCallback);
m_rtcpReportTimer.Change(interval, Timeout.Infinite);
}
}

Expand Down Expand Up @@ -362,7 +363,8 @@ private void SendReportTimerCallback(Object stateInfo)
var interval = GetNextRtcpInterval(RTCP_MINIMUM_REPORT_PERIOD_MILLISECONDS);
if (m_rtcpReportTimer == null)
{
m_rtcpReportTimer = new Timer(SendReportTimerCallback, null, interval, Timeout.Infinite);
m_rtcpReportTimer = new Timer(SendReportTimerCallback);
m_rtcpReportTimer.Change(interval, Timeout.Infinite);
}
else
{
Expand Down
6 changes: 4 additions & 2 deletions src/net/SCTP/SctpAssociation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ internal void OnPacketReceived(SctpPacket packet)
SendPacket(cookieEchoPkt);
SetState(SctpAssociationState.CookieEchoed);

_t1Cookie = new Timer(T1CookieTimerExpired, cookieEchoPkt, T1_COOKIE_TIMER_MILLISECONDS, T1_COOKIE_TIMER_MILLISECONDS);
_t1Cookie = new Timer(T1CookieTimerExpired, cookieEchoPkt, Timeout.Infinite, Timeout.Infinite);
_t1Cookie.Change(T1_COOKIE_TIMER_MILLISECONDS, T1_COOKIE_TIMER_MILLISECONDS);
}
break;

Expand Down Expand Up @@ -707,7 +708,8 @@ private void SendInit()
byte[] buffer = init.GetBytes();
_sctpTransport.Send(ID, buffer, 0, buffer.Length);

_t1Init = new Timer(T1InitTimerExpired, init, T1_INIT_TIMER_MILLISECONDS, T1_INIT_TIMER_MILLISECONDS);
_t1Init = new Timer(T1InitTimerExpired, init, Timeout.Infinite, Timeout.Infinite);
_t1Init.Change(T1_INIT_TIMER_MILLISECONDS, T1_INIT_TIMER_MILLISECONDS);
}
}

Expand Down