Skip to content

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Jan 31, 2020

This PR brings in the following changes:

  1. The new CUDTGroup class (some methods are removed also from the header in order to cut dependencies of management parts).
  2. Hookup into the CUDTSocket class.
  3. Extra methods in CUDT class that are strictly connected to operate with the group object.

Mikołaj Małecki added 30 commits January 23, 2020 13:41
Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The set property naming property(value) does not follow the current naming convention.
It has to be changed to something like setProperty(value). In favor of faster merging, we'll probably create an issue for that and add it to the technical dept.

  • Create an issue to rename the property function

srtcore/core.cpp Outdated
Comment on lines 10741 to 10772
if (m_RcvBaseSeqNo == -1)
{
// One socket reported readiness, while no reading operation
// has ever been done. Whatever the sequence number is, it will
// be taken as a good deal and reading will be accepted.
ready = true;
}
else if ( (seqdiff = CSeqNo::seqcmp(sequence, m_RcvBaseSeqNo)) > 0 )
{
// Case diff == 1: The very next. Surely read-ready.

// Case diff > 1:
// We have an ahead packet. There's one strict condition in which
// we may believe it needs to be delivered - when KANGAROO->HORSE
// transition is allowed. Stating that the time calculation is done
// exactly the same way on every link in the redundancy group, when
// it came to a situation that a packet from one link is ready for
// extraction while it has jumped over some packet, it has surely
// happened due to TLPKTDROP, and if it happened on at least one link,
// we surely don't have this packet ready on any other link.

// This might prove not exactly true, especially when at the moment
// when this happens another link may surprisinly receive this lacking
// packet, so the situation gets suddenly repaired after this function
// is called, the only result of it would be that it will really get
// the very next sequence, even though this function doesn't know it
// yet, but surely in both cases the situation is the same: the medium
// is ready for reading, no matter what packet will turn out to be
// returned when reading is done.

ready = true;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the body of both conditions contain more logic in further PRs? Right now they share the one and only statement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but mind that these two conditional expressions can't be bound into one anyway. And this comment is also important.

srtcore/core.cpp Outdated
Comment on lines 10817 to 10818
int seqdiff = CSeqNo::seqcmp(a.sequence, m_RcvBaseSeqNo);
if ( seqdiff == 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const + no whitespaces inside of braces

srtcore/core.cpp Outdated
Comment on lines 10838 to 10844
string CUDTGroup::StateStr(CUDTGroup::GroupState st)
{
static string states [] = { "PENDING", "IDLE", "RUNNING", "BROKEN" };
if (int(st) < 5)
return states[st];
return string("UNKNOWN");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to return const char* to avoid copying?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and potential crashes, too.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still return a string. instead of const char*

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UNKNOWN wasn't in the map - but still, should be possible...

@maxsharabayko maxsharabayko added this to the v1.5.0 milestone Feb 4, 2020
@maxsharabayko maxsharabayko added [core] Area: Changes in SRT library core Type: Enhancement Indicates new feature requests labels Feb 4, 2020
@maxsharabayko maxsharabayko merged commit 2e25c45 into Haivision:master Feb 4, 2020
@maxsharabayko maxsharabayko mentioned this pull request Feb 6, 2020
33 tasks
@mbakholdina mbakholdina modified the milestones: v1.5.0, v1.4.2 Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants