librtcdcpp
librtcdcpp copied to clipboard
unreliable channels?
Looking through the DataChannel.hpp channel types, there doesn't seem to be an unreliable option. Perhaps I am mis-understanding what webRTC means by unreliable -- is "reliable_unordered" what I am looking for? What I was expecting unreliable to be would be both unordered (of course) but also no guarantee of sending the data, whereas reliable_unordered sounds to me like it would be unordered but data would be re-sent until acknowledged on the other side (which I don't care about).
Here are the explanations from https://tools.ietf.org/html/draft-ietf-rtcweb-data-protocol-08#section-5.1. I think the "PARTIAL_RELIABLE" ones might be the what you are looking for.
DATA_CHANNEL_RELIABLE (0x00): The Data Channel provides a
reliable in-order bi-directional communication.
DATA_CHANNEL_RELIABLE_UNORDERED (0x80): The Data Channel provides
a reliable unordered bi-directional communication.
DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT (0x01): The Data Channel
provides a partially-reliable in-order bi-directional
communication. User messages will not be retransmitted more
times than specified in the Reliability Parameter.
DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED (0x81): The Data
Channel provides a partial reliable unordered bi-directional
communication. User messages will not be retransmitted more
times than specified in the Reliability Parameter.
DATA_CHANNEL_PARTIAL_RELIABLE_TIMED (0x02): The Data Channel
provides a partial reliable in-order bi-directional
communication. User messages might not be transmitted or
retransmitted after a specified life-time given in milliseconds
in the Reliability Parameter. This life-time starts
when providing the user message to the protocol stack.
DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED (0x82): The Data
Channel provides a partial reliable unordered bi-directional
communication. User messages might not be transmitted or
retransmitted after a specified life-time given in milli-
seconds in the Reliability Parameter. This life-time starts
when providing the user message to the protocol stack.
Ah. I think you're right.
Still, in the WebRTC documentation and tutorials, typically the behavior of these unreliable channels is controlled by a 'maxRetries' or 'maxTimeout' style parameter. I can't seem to find where such a parameter might be set in librtcdcpp. And in the absence of a such a parameter, what would the behavior PARTIAL_RELIABLE data channels be?
In fact, scanning through the DataChannel.cpp source code, the chan_type parameter seems to be unused.
Still, in the WebRTC documentation and tutorials, typically the behavior of these unreliable channels is controlled by a 'maxRetries' or 'maxTimeout' style parameter. I can't seem to find where such a parameter might be set in librtcdcpp. And in the absence of a such a parameter, what would the behavior PARTIAL_RELIABLE data channels be?
That parameter would be the reliability
parameter for which the proper API is not yet implemented in this library.
In fact, scanning through the DataChannel.cpp source code, the chan_type parameter seems to be unused.
The library does not support initiating a data channel yet. I have a PR for this, but I hardcoded the RELIABLE chan_type and other params like reliability. Plus it would need more tweaks to actually make it work accordingly at the SCTP layer.
I've added the chan_type and reliability features to the API: https://github.com/chadnickbok/librtcdcpp/pull/30/commits/f20cf66815448f4068a0d00f972e7603c0f133d7