示例#1
0
        public void ValidateSctpStreamParameters(SctpStreamParameters params_)
        {
            // ordered is optional.
            var orderedGiven = false;

            if (params_.Ordered.HasValue)
            {
                orderedGiven = true;
            }
            else
            {
                params_.Ordered = true;
            }

            if (params_.MaxPacketLifeTime.HasValue && params_.MaxRetransmits.HasValue)
            {
                throw new Exception("cannot provide both maxPacketLifeTime and maxRetransmits");
            }

            if (orderedGiven && (bool)params_.Ordered &&
                (params_.MaxPacketLifeTime.HasValue || params_.MaxRetransmits.HasValue))
            {
                throw new Exception("cannot be ordered with maxPacketLifeTime or maxRetransmits");
            }
            else if (!orderedGiven && (params_.MaxPacketLifeTime.HasValue || params_.MaxRetransmits.HasValue))
            {
                params_.Ordered = false;
            }
        }
示例#2
0
        public DataProducer(string id, IRTCDataChannel dataChannel, SctpStreamParameters sctpStreamParameters,
                            Dictionary <string, object> appData)
        {
            Id                   = id;
            _dataChannel         = dataChannel;
            SctpStreamParameters = sctpStreamParameters;
            AppData              = appData;
            Closed               = false;

            HandleDataChannel();
        }