Skip to content

Commit

Permalink
[core] Added retrieving weight setting in group data (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethouris committed Sep 7, 2020
1 parent c9742e7 commit 889085e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/API-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ typedef struct SRT_SocketGroupData_
SRTSOCKET id;
struct sockaddr_storage peeraddr;
SRT_SOCKSTATUS sockstate;
int weight;
SRT_MEMBERSTATUS memberstate;
int result;

Expand All @@ -696,6 +697,7 @@ where:
* `id`: member socket ID
* `peeraddr`: address to which `id` should be connected
* `sockstate`: current connection status (see [`srt_getsockstate`](#srt_getsockstate))
* `weight`: current weight value set on the link
* `memberstate`: current state of the member (see below)
* `result`: result of the operation (if this operation recently updated this structure)

Expand Down
2 changes: 2 additions & 0 deletions srtcore/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,8 @@ int CUDTGroup::getGroupData(SRT_SOCKGROUPDATA* pdata, size_t* psize)
pdata[i].result = 0;
pdata[i].memberstate = d->sndstate;
}

pdata[i].weight = d->weight;
}

return m_Group.size();
Expand Down
1 change: 1 addition & 0 deletions srtcore/srt.h
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ typedef struct SRT_SocketGroupData_
SRTSOCKET id;
struct sockaddr_storage peeraddr; // Don't want to expose sockaddr_any to public API
SRT_SOCKSTATUS sockstate;
int weight;
SRT_MEMBERSTATUS memberstate;
int result;
} SRT_SOCKGROUPDATA;
Expand Down

0 comments on commit 889085e

Please sign in to comment.