@@ -258,7 +258,7 @@ CUDTGroup::CUDTGroup(SRT_GROUP_TYPE gtype)
258
258
, m_iBusy()
259
259
, m_iSndOldestMsgNo(SRT_MSGNO_NONE)
260
260
, m_iSndAckedMsgNo(SRT_MSGNO_NONE)
261
-
, m_uOPT_StabilityTimeout(CSrtConfig::COMM_DEF_STABILITY_TIMEOUT_US)
261
+
, m_uOPT_MinStabilityTimeout_us(1000 * CSrtConfig::COMM_DEF_MIN_STABILITY_TIMEOUT_MS)
262
262
// -1 = "undefined"; will become defined with first added socket
263
263
, m_iMaxPayloadSize(-1)
264
264
, m_bSynRecving(true)
@@ -387,41 +387,43 @@ void CUDTGroup::setOpt(SRT_SOCKOPT optName, const void* optval, int optlen)
387
387
m_iRcvTimeOut = cast_optval<int>(optval, optlen);
388
388
break;
389
389
390
-
case SRTO_GROUPSTABTIMEO:
390
+
case SRTO_GROUPMINSTABLETIMEO:
391
391
{
392
-
const int val = cast_optval<int>(optval, optlen);
392
+
const int val_ms = cast_optval<int>(optval, optlen);
393
+
const int min_timeo_ms = (int) CSrtConfig::COMM_DEF_MIN_STABILITY_TIMEOUT_MS;
394
+
if (val_ms < min_timeo_ms)
395
+
{
396
+
LOGC(qmlog.Error,
397
+
log << "group option: SRTO_GROUPMINSTABLETIMEO min allowed value is " << min_timeo_ms << " ms.");
398
+
throw CUDTException(MJ_NOTSUP, MN_INVAL, 0);
399
+
}
393
400
394
401
// Search if you already have SRTO_PEERIDLETIMEO set
395
-
int idletmo = CSrtConfig::COMM_RESPONSE_TIMEOUT_MS;
402
+
int idletmo = CSrtConfig::COMM_RESPONSE_TIMEOUT_MS;
396
403
vector<ConfigItem>::iterator f =
397
404
find_if(m_config.begin(), m_config.end(), ConfigItem::OfType(SRTO_PEERIDLETIMEO));
398
405
if (f != m_config.end())
399
406
{
400
407
f->get(idletmo); // worst case, it will leave it unchanged.
401
408
}
402
409
403
-
if (val >= idletmo)
410
+
if (val_ms > idletmo)
404
411
{
405
412
LOGC(qmlog.Error,
406
-
log << "group option: SRTO_GROUPSTABTIMEO(" << val << ") exceeds SRTO_PEERIDLETIMEO(" << idletmo
407
-
<< ")");
413
+
log << "group option: SRTO_GROUPMINSTABLETIMEO=" << val_ms << " exceeds SRTO_PEERIDLETIMEO=" << idletmo);
408
414
throw CUDTException(MJ_NOTSUP, MN_INVAL, 0);
409
415
}
410
416
411
-
m_uOPT_StabilityTimeout = val * 1000;
417
+
m_uOPT_MinStabilityTimeout_us = 1000 * val_ms;
412
418
}
413
419
414
420
break;
415
421
416
-
// XXX Currently no socket groups allow any other
417
-
// congestion control mode other than live.
418
422
case SRTO_CONGESTION:
419
-
{
423
+
// Currently no socket groups allow any other
424
+
// congestion control mode other than live.
420
425
LOGP(gmlog.Error, "group option: SRTO_CONGESTION is only allowed as 'live' and cannot be changed");
421
426
throw CUDTException(MJ_NOTSUP, MN_INVAL, 0);
422
-
}
423
-
424
-
// Other options to be specifically interpreted by group may follow.
425
427
426
428
default:
427
429
break;
@@ -430,7 +432,6 @@ void CUDTGroup::setOpt(SRT_SOCKOPT optName, const void* optval, int optlen)
430
432
// All others must be simply stored for setting on a socket.
431
433
// If the group is already open and any post-option is about
432
434
// to be modified, it must be allowed and applied on all sockets.
433
-
434
435
if (m_bOpened)
435
436
{
436
437
// There's at least one socket in the group, so only
@@ -515,6 +516,9 @@ void CUDTGroup::deriveSettings(CUDT* u)
515
516
// SRTO_SNDTIMEO
516
517
m_iSndTimeOut = u->m_config.iSndTimeOut;
517
518
519
+
// SRTO_GROUPMINSTABLETIMEO
520
+
m_uOPT_MinStabilityTimeout_us = 1000 * u->m_config.uMinStabilityTimeout_ms;
521
+
518
522
// Ok, this really is disgusting, but there's only one way
519
523
// to properly do it. Would be nice to have some more universal
520
524
// connection between an option symbolic name and the internals
@@ -564,8 +568,7 @@ void CUDTGroup::deriveSettings(CUDT* u)
564
568
IM(SRTO_MINVERSION, uMinimumPeerSrtVersion);
565
569
IM(SRTO_ENFORCEDENCRYPTION, bEnforcedEnc);
566
570
IM(SRTO_IPV6ONLY, iIpV6Only);
567
-
IM(SRTO_PEERIDLETIMEO, iPeerIdleTimeout);
568
-
IM(SRTO_GROUPSTABTIMEO, uStabilityTimeout);
571
+
IM(SRTO_PEERIDLETIMEO, iPeerIdleTimeout_ms);
569
572
570
573
importOption(m_config, SRTO_PACKETFILTER, u->m_config.sPacketFilterConfig.str());
571
574
@@ -760,6 +763,8 @@ static bool getOptDefault(SRT_SOCKOPT optname, void* pw_optval, int& w_optlen)
760
763
RD(true);
761
764
case SRTO_PAYLOADSIZE:
762
765
RD(0);
766
+
case SRTO_GROUPMINSTABLETIMEO:
767
+
RD(CSrtConfig::COMM_DEF_MIN_STABILITY_TIMEOUT_MS);
763
768
}
764
769
765
770
#undef RD
@@ -3328,7 +3333,8 @@ CUDTGroup::BackupMemberState CUDTGroup::sendBackup_QualifyActiveState(const gli_
3328
3333
const CUDT& u = d->ps->core();
3329
3334
3330
3335
const uint32_t latency_us = u.peerLatency_us();
3331
-
const int32_t min_stability_us = 60000; // Minimum Link Stability Timeout: 60ms.
3336
+
3337
+
const int32_t min_stability_us = m_uOPT_MinStabilityTimeout_us;
3332
3338
const int64_t initial_stabtout_us = max<int64_t>(min_stability_us, latency_us);
3333
3339
const int64_t probing_period_us = initial_stabtout_us + 5 * CUDT::COMM_SYN_INTERVAL_US;
3334
3340
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4