File tree 1 file changed +13
-13
lines changed
1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -3281,19 +3281,19 @@ class RTCSession extends EventManager implements Owner {
3281
3281
3282
3282
// I'm the refresher.
3283
3283
if (_sessionTimers.refresher) {
3284
- _sessionTimers.timer = setTimeout (() {
3285
- if (_state == RtcSessionState .terminated) {
3286
- return ;
3287
- }
3288
-
3289
- logger.d ('runSessionTimer() | sending session refresh request' );
3290
-
3291
- if (_sessionTimers.refreshMethod == SipMethod . UPDATE ) {
3292
- _sendUpdate ();
3293
- } else {
3294
- _sendReinvite ();
3295
- }
3296
- }, expires ! * 500 ); // Half the given interval (as the RFC states).
3284
+ final int delayMs = expires ! * 500 ;
3285
+ _sessionTimers.timer = Timer . periodic (
3286
+ Duration (milliseconds : delayMs),
3287
+ (_) {
3288
+ if (_state == RtcSessionState .terminated) return ;
3289
+ logger.d ('runSessionTimer() | sending session refresh request with expires=$ expires , delayMs=$ delayMs ' );
3290
+ if (_sessionTimers.refreshMethod == SipMethod . UPDATE ) {
3291
+ _sendUpdate ();
3292
+ } else {
3293
+ _sendReinvite ();
3294
+ }
3295
+ },
3296
+ );
3297
3297
}
3298
3298
// I'm not the refresher.
3299
3299
else {
You can’t perform that action at this time.
0 commit comments