diff --git a/DOC.md b/DOC.md index b491fc5b0..50ad1758b 100644 --- a/DOC.md +++ b/DOC.md @@ -644,8 +644,8 @@ Arguments: - `reliability`: a structure of reliability settings containing: - `unordered`: if `true`, the Data Channel will not enforce message ordering, else it will be ordered - `unreliable`: if `true`, the Data Channel will not enforce strict reliability, else it will be reliable - - `maxPacketLifeTime`: if unreliable, maximum packet life time in milliseconds - - `maxRetransmits`: if unreliable and maxPacketLifeTime is 0, maximum number of retransmissions (0 means no retransmission) + - `maxPacketLifeTime`: if unreliable, time window in milliseconds during which transmissions and retransmissions may occur + - `maxRetransmits`: if unreliable and maxPacketLifeTime is 0, maximum number of attempted retransmissions (0 means no retransmission) - `protocol` (optional): a user-defined UTF-8 string representing the Data Channel protocol, empty if NULL - `negotiated`: if `true`, the Data Channel is assumed to be negotiated by the user and won't be negotiated by the WebRTC layer - `manualStream`: if `true`, the Data Channel will use `stream` as stream ID, else an available id is automatically selected diff --git a/include/rtc/rtc.h b/include/rtc/rtc.h index 55b26d3fa..4750d7798 100644 --- a/include/rtc/rtc.h +++ b/include/rtc/rtc.h @@ -245,8 +245,8 @@ RTC_C_EXPORT int rtcReceiveMessage(int id, char *buffer, int *size); typedef struct { bool unordered; bool unreliable; - int maxPacketLifeTime; // ignored if reliable - int maxRetransmits; // ignored if reliable + unsigned int maxPacketLifeTime; // ignored if reliable + unsigned int maxRetransmits; // ignored if reliable } rtcReliability; typedef struct { diff --git a/pages/content/pages/reference.md b/pages/content/pages/reference.md index 19abec828..ea10e5c10 100644 --- a/pages/content/pages/reference.md +++ b/pages/content/pages/reference.md @@ -647,8 +647,8 @@ Arguments: - `reliability`: a structure of reliability settings containing: - `unordered`: if `true`, the Data Channel will not enforce message ordering, else it will be ordered - `unreliable`: if `true`, the Data Channel will not enforce strict reliability, else it will be reliable - - `maxPacketLifeTime`: if unreliable, maximum packet life time in milliseconds - - `maxRetransmits`: if unreliable and maxPacketLifeTime is 0, maximum number of retransmissions (0 means no retransmission) + - `maxPacketLifeTime`: if unreliable, time window in milliseconds during which transmissions and retransmissions may occur + - `maxRetransmits`: if unreliable and maxPacketLifeTime is 0, maximum number of attempted retransmissions (0 means no retransmission) - `protocol` (optional): a user-defined UTF-8 string representing the Data Channel protocol, empty if NULL - `negotiated`: if `true`, the Data Channel is assumed to be negotiated by the user and won't be negotiated by the WebRTC layer - `manualStream`: if `true`, the Data Channel will use `stream` as stream ID, else an available id is automatically selected diff --git a/src/capi.cpp b/src/capi.cpp index 25e953185..5a2982cbc 100644 --- a/src/capi.cpp +++ b/src/capi.cpp @@ -966,12 +966,12 @@ int rtcGetDataChannelReliability(int dc, rtcReliability *reliability) { Reliability dcr = dataChannel->reliability(); std::memset(reliability, 0, sizeof(*reliability)); reliability->unordered = dcr.unordered; - if (dcr.type == Reliability::Type::Timed) { + if(dcr.maxPacketLifeTime) { reliability->unreliable = true; - reliability->maxPacketLifeTime = int(std::get(dcr.rexmit).count()); - } else if (dcr.type == Reliability::Type::Rexmit) { + reliability->maxPacketLifeTime = dcr.maxPacketLifeTime->count(); + } else if (dcr.maxRetransmits) { reliability->unreliable = true; - reliability->maxRetransmits = std::get(dcr.rexmit); + reliability->maxRetransmits = *dcr.maxRetransmits; } else { reliability->unreliable = false; }