/* * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/ #include"net/dcsctp/tx/stream_scheduler.h"
std::optional<SendQueue::DataToSend> StreamScheduler::Produce(
webrtc::Timestamp now,
size_t max_size) { // For non-interleaved streams, avoid rescheduling while still sending a // message as it needs to be sent in full. For interleaved messaging, // reschedule for every I-DATA chunk sent. bool rescheduling =
enable_message_interleaving_ || !currently_sending_a_message_;
// One side-effect of rescheduling is that the new stream will not be present // in `active_streams`.
size_t bytes_to_send_next = current_stream_->bytes_to_send_in_next_message(); if (rescheduling && bytes_to_send_next > 0) {
current_stream_->MakeActive(bytes_to_send_next);
} elseif (!rescheduling && bytes_to_send_next == 0) {
current_stream_->MakeInactive();
}
// Perform round-robin scheduling by letting the stream have its next virtual // finish time in the future. It doesn't matter how far into the future, just // any positive number so that any other stream that has the same virtual // finish time as this stream gets to produce their data before revisiting // this stream. return VirtualTime(*current_virtual_time_ + 1);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.