mediasoup 3.19.21 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node/lib/ActiveSpeakerObserver.js +34 -1
- package/node/lib/AudioLevelObserver.js +35 -2
- package/node/lib/Channel.d.ts.map +1 -1
- package/node/lib/Channel.js +37 -5
- package/node/lib/Consumer.js +39 -6
- package/node/lib/DataConsumer.d.ts.map +1 -1
- package/node/lib/DataConsumer.js +39 -5
- package/node/lib/DataConsumerTypes.d.ts +1 -0
- package/node/lib/DataConsumerTypes.d.ts.map +1 -1
- package/node/lib/DataProducer.js +37 -4
- package/node/lib/DirectTransport.js +37 -4
- package/node/lib/DirectTransportTypes.d.ts +7 -2
- package/node/lib/DirectTransportTypes.d.ts.map +1 -1
- package/node/lib/Logger.js +4 -1
- package/node/lib/PipeTransport.d.ts +3 -1
- package/node/lib/PipeTransport.d.ts.map +1 -1
- package/node/lib/PipeTransport.js +56 -5
- package/node/lib/PipeTransportTypes.d.ts +28 -8
- package/node/lib/PipeTransportTypes.d.ts.map +1 -1
- package/node/lib/PlainTransport.d.ts +3 -1
- package/node/lib/PlainTransport.d.ts.map +1 -1
- package/node/lib/PlainTransport.js +54 -3
- package/node/lib/PlainTransportTypes.d.ts +27 -7
- package/node/lib/PlainTransportTypes.d.ts.map +1 -1
- package/node/lib/Producer.js +40 -7
- package/node/lib/Router.d.ts +5 -5
- package/node/lib/Router.d.ts.map +1 -1
- package/node/lib/Router.js +81 -36
- package/node/lib/RouterTypes.d.ts +25 -3
- package/node/lib/RouterTypes.d.ts.map +1 -1
- package/node/lib/RtpObserver.js +36 -3
- package/node/lib/Transport.d.ts +3 -1
- package/node/lib/Transport.d.ts.map +1 -1
- package/node/lib/Transport.js +74 -22
- package/node/lib/TransportTypes.d.ts +2 -1
- package/node/lib/TransportTypes.d.ts.map +1 -1
- package/node/lib/WebRtcServer.js +36 -3
- package/node/lib/WebRtcTransport.d.ts +3 -1
- package/node/lib/WebRtcTransport.d.ts.map +1 -1
- package/node/lib/WebRtcTransport.js +55 -4
- package/node/lib/WebRtcTransportTypes.d.ts +27 -7
- package/node/lib/WebRtcTransportTypes.d.ts.map +1 -1
- package/node/lib/Worker.d.ts +2 -1
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +71 -25
- package/node/lib/WorkerTypes.d.ts +0 -4
- package/node/lib/WorkerTypes.d.ts.map +1 -1
- package/node/lib/enhancedEvents.d.ts +2 -2
- package/node/lib/enhancedEvents.d.ts.map +1 -1
- package/node/lib/enhancedEvents.js +0 -2
- package/node/lib/fbs/active-speaker-observer/active-speaker-observer-options.js +34 -1
- package/node/lib/fbs/active-speaker-observer/dominant-speaker-notification.js +34 -1
- package/node/lib/fbs/audio-level-observer/audio-level-observer-options.js +34 -1
- package/node/lib/fbs/audio-level-observer/volume.js +34 -1
- package/node/lib/fbs/audio-level-observer/volumes-notification.js +34 -1
- package/node/lib/fbs/common/string-string-array.js +34 -1
- package/node/lib/fbs/common/string-string.js +34 -1
- package/node/lib/fbs/common/string-uint8.js +34 -1
- package/node/lib/fbs/common/uint16-string.js +34 -1
- package/node/lib/fbs/common/uint32-string.js +34 -1
- package/node/lib/fbs/consumer/base-consumer-dump.js +34 -1
- package/node/lib/fbs/consumer/consumer-dump.js +34 -1
- package/node/lib/fbs/consumer/consumer-layers.js +34 -1
- package/node/lib/fbs/consumer/consumer-score.js +34 -1
- package/node/lib/fbs/consumer/dump-response.js +34 -1
- package/node/lib/fbs/consumer/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/consumer/fir-trace-info.js +34 -1
- package/node/lib/fbs/consumer/get-stats-response.js +34 -1
- package/node/lib/fbs/consumer/key-frame-trace-info.js +34 -1
- package/node/lib/fbs/consumer/layers-change-notification.js +34 -1
- package/node/lib/fbs/consumer/pli-trace-info.js +34 -1
- package/node/lib/fbs/consumer/rtp-notification.js +34 -1
- package/node/lib/fbs/consumer/rtp-trace-info.js +34 -1
- package/node/lib/fbs/consumer/score-notification.js +34 -1
- package/node/lib/fbs/consumer/set-preferred-layers-request.js +34 -1
- package/node/lib/fbs/consumer/set-preferred-layers-response.js +34 -1
- package/node/lib/fbs/consumer/set-priority-request.js +34 -1
- package/node/lib/fbs/consumer/set-priority-response.js +34 -1
- package/node/lib/fbs/consumer/trace-notification.js +34 -1
- package/node/lib/fbs/data-consumer/add-subchannel-request.js +34 -1
- package/node/lib/fbs/data-consumer/add-subchannel-response.js +34 -1
- package/node/lib/fbs/data-consumer/buffered-amount-low-notification.js +34 -1
- package/node/lib/fbs/data-consumer/dump-response.d.ts +5 -2
- package/node/lib/fbs/data-consumer/dump-response.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer/dump-response.js +60 -16
- package/node/lib/fbs/data-consumer/get-buffered-amount-response.js +34 -1
- package/node/lib/fbs/data-consumer/get-stats-response.js +34 -1
- package/node/lib/fbs/data-consumer/message-notification.js +34 -1
- package/node/lib/fbs/data-consumer/remove-subchannel-request.js +34 -1
- package/node/lib/fbs/data-consumer/remove-subchannel-response.js +34 -1
- package/node/lib/fbs/data-consumer/send-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-buffered-amount-low-threshold-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-subchannels-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-subchannels-response.js +34 -1
- package/node/lib/fbs/data-consumer/type.d.ts +5 -0
- package/node/lib/fbs/data-consumer/type.d.ts.map +1 -0
- package/node/lib/fbs/data-consumer/type.js +10 -0
- package/node/lib/fbs/data-consumer.d.ts +1 -0
- package/node/lib/fbs/data-consumer.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer.js +3 -1
- package/node/lib/fbs/data-producer/dump-response.js +34 -1
- package/node/lib/fbs/data-producer/get-stats-response.js +34 -1
- package/node/lib/fbs/data-producer/send-notification.js +34 -1
- package/node/lib/fbs/direct-transport/direct-transport-options.js +34 -1
- package/node/lib/fbs/direct-transport/dump-response.js +34 -1
- package/node/lib/fbs/direct-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/direct-transport/rtcp-notification.js +34 -1
- package/node/lib/fbs/lib-uring/dump.js +34 -1
- package/node/lib/fbs/log/log.js +34 -1
- package/node/lib/fbs/message/message.js +34 -1
- package/node/lib/fbs/notification/body.d.ts +24 -22
- package/node/lib/fbs/notification/body.d.ts.map +1 -1
- package/node/lib/fbs/notification/body.js +24 -20
- package/node/lib/fbs/notification/event.d.ts +27 -26
- package/node/lib/fbs/notification/event.d.ts.map +1 -1
- package/node/lib/fbs/notification/event.js +27 -26
- package/node/lib/fbs/notification/notification.d.ts +3 -2
- package/node/lib/fbs/notification/notification.d.ts.map +1 -1
- package/node/lib/fbs/notification/notification.js +34 -1
- package/node/lib/fbs/pipe-transport/connect-request.js +34 -1
- package/node/lib/fbs/pipe-transport/connect-response.js +34 -1
- package/node/lib/fbs/pipe-transport/dump-response.js +34 -1
- package/node/lib/fbs/pipe-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/pipe-transport/pipe-transport-options.js +34 -1
- package/node/lib/fbs/plain-transport/connect-request.js +34 -1
- package/node/lib/fbs/plain-transport/connect-response.js +34 -1
- package/node/lib/fbs/plain-transport/dump-response.js +34 -1
- package/node/lib/fbs/plain-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/plain-transport/plain-transport-options.js +34 -1
- package/node/lib/fbs/plain-transport/rtcp-tuple-notification.js +34 -1
- package/node/lib/fbs/plain-transport/tuple-notification.js +34 -1
- package/node/lib/fbs/producer/dump-response.js +34 -1
- package/node/lib/fbs/producer/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/producer/fir-trace-info.js +34 -1
- package/node/lib/fbs/producer/get-stats-response.js +34 -1
- package/node/lib/fbs/producer/key-frame-trace-info.js +34 -1
- package/node/lib/fbs/producer/pli-trace-info.js +34 -1
- package/node/lib/fbs/producer/rtp-trace-info.js +34 -1
- package/node/lib/fbs/producer/score-notification.js +34 -1
- package/node/lib/fbs/producer/score.js +34 -1
- package/node/lib/fbs/producer/send-notification.js +34 -1
- package/node/lib/fbs/producer/sr-trace-info.js +34 -1
- package/node/lib/fbs/producer/trace-notification.js +34 -1
- package/node/lib/fbs/producer/video-orientation-change-notification.js +34 -1
- package/node/lib/fbs/request/request.js +34 -1
- package/node/lib/fbs/response/response.js +34 -1
- package/node/lib/fbs/router/close-rtp-observer-request.js +34 -1
- package/node/lib/fbs/router/close-transport-request.js +34 -1
- package/node/lib/fbs/router/create-active-speaker-observer-request.js +34 -1
- package/node/lib/fbs/router/create-audio-level-observer-request.js +34 -1
- package/node/lib/fbs/router/create-direct-transport-request.js +34 -1
- package/node/lib/fbs/router/create-pipe-transport-request.js +34 -1
- package/node/lib/fbs/router/create-plain-transport-request.js +34 -1
- package/node/lib/fbs/router/create-web-rtc-transport-request.js +34 -1
- package/node/lib/fbs/router/dump-response.js +34 -1
- package/node/lib/fbs/rtp-observer/add-producer-request.js +34 -1
- package/node/lib/fbs/rtp-observer/remove-producer-request.js +34 -1
- package/node/lib/fbs/rtp-packet/dump.js +34 -1
- package/node/lib/fbs/rtp-parameters/boolean.js +34 -1
- package/node/lib/fbs/rtp-parameters/codec-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/double.js +34 -1
- package/node/lib/fbs/rtp-parameters/encoding-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/integer32-array.js +34 -1
- package/node/lib/fbs/rtp-parameters/integer32.js +34 -1
- package/node/lib/fbs/rtp-parameters/parameter.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtcp-feedback.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtcp-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-codec-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-encoding-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-header-extension-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtx.js +34 -1
- package/node/lib/fbs/rtp-parameters/string.js +34 -1
- package/node/lib/fbs/rtp-stream/base-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/bitrate-by-layer.js +34 -1
- package/node/lib/fbs/rtp-stream/dump.js +34 -1
- package/node/lib/fbs/rtp-stream/params.js +34 -1
- package/node/lib/fbs/rtp-stream/recv-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/send-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/stats.js +34 -1
- package/node/lib/fbs/rtx-stream/params.js +34 -1
- package/node/lib/fbs/rtx-stream/rtx-dump.js +34 -1
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.d.ts +24 -0
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.d.ts.map +1 -0
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.js +102 -0
- package/node/lib/fbs/sctp-association.d.ts +1 -0
- package/node/lib/fbs/sctp-association.d.ts.map +1 -1
- package/node/lib/fbs/sctp-association.js +4 -1
- package/node/lib/fbs/sctp-parameters/num-sctp-streams.js +34 -1
- package/node/lib/fbs/sctp-parameters/sctp-parameters.d.ts +14 -14
- package/node/lib/fbs/sctp-parameters/sctp-parameters.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters/sctp-parameters.js +73 -40
- package/node/lib/fbs/sctp-parameters/sctp-stream-parameters.js +34 -1
- package/node/lib/fbs/sctp-parameters.d.ts +0 -1
- package/node/lib/fbs/sctp-parameters.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters.js +1 -4
- package/node/lib/fbs/srtp-parameters/srtp-parameters.js +34 -1
- package/node/lib/fbs/transport/bwe-trace-info.js +34 -1
- package/node/lib/fbs/transport/close-consumer-request.js +34 -1
- package/node/lib/fbs/transport/close-data-consumer-request.js +34 -1
- package/node/lib/fbs/transport/close-data-producer-request.js +34 -1
- package/node/lib/fbs/transport/close-producer-request.js +34 -1
- package/node/lib/fbs/transport/consume-data-request.d.ts +1 -1
- package/node/lib/fbs/transport/consume-data-request.js +35 -2
- package/node/lib/fbs/transport/consume-request.js +34 -1
- package/node/lib/fbs/transport/consume-response.js +34 -1
- package/node/lib/fbs/transport/dump.d.ts +7 -4
- package/node/lib/fbs/transport/dump.d.ts.map +1 -1
- package/node/lib/fbs/transport/dump.js +66 -22
- package/node/lib/fbs/transport/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/transport/listen-info.js +34 -1
- package/node/lib/fbs/transport/options.d.ts +14 -14
- package/node/lib/fbs/transport/options.d.ts.map +1 -1
- package/node/lib/fbs/transport/options.js +92 -51
- package/node/lib/fbs/transport/port-range.js +34 -1
- package/node/lib/fbs/transport/produce-data-request.js +34 -1
- package/node/lib/fbs/transport/produce-request.js +34 -1
- package/node/lib/fbs/transport/produce-response.js +34 -1
- package/node/lib/fbs/transport/recv-rtp-header-extensions.js +34 -1
- package/node/lib/fbs/transport/restart-ice-response.js +34 -1
- package/node/lib/fbs/transport/rtp-listener.js +34 -1
- package/node/lib/fbs/transport/sctp-listener.js +34 -1
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.d.ts +22 -0
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.js +93 -0
- package/node/lib/fbs/transport/sctp-state-change-notification.js +34 -1
- package/node/lib/fbs/transport/send-rtcp-notification.js +34 -1
- package/node/lib/fbs/transport/set-max-incoming-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/socket-flags.js +34 -1
- package/node/lib/fbs/transport/stats.js +34 -1
- package/node/lib/fbs/transport/trace-notification.js +34 -1
- package/node/lib/fbs/transport/tuple.js +34 -1
- package/node/lib/fbs/transport.d.ts +1 -0
- package/node/lib/fbs/transport.d.ts.map +1 -1
- package/node/lib/fbs/transport.js +5 -2
- package/node/lib/fbs/web-rtc-server/dump-response.js +34 -1
- package/node/lib/fbs/web-rtc-server/ice-user-name-fragment.js +34 -1
- package/node/lib/fbs/web-rtc-server/ip-port.js +34 -1
- package/node/lib/fbs/web-rtc-server/tuple-hash.js +34 -1
- package/node/lib/fbs/web-rtc-transport/connect-request.js +34 -1
- package/node/lib/fbs/web-rtc-transport/connect-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dtls-parameters.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dtls-state-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dump-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/fingerprint.js +34 -1
- package/node/lib/fbs/web-rtc-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-candidate.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-parameters.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-selected-tuple-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-state-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/listen-individual.js +34 -1
- package/node/lib/fbs/web-rtc-transport/listen-server.js +34 -1
- package/node/lib/fbs/web-rtc-transport/web-rtc-transport-options.js +34 -1
- package/node/lib/fbs/worker/channel-message-handlers.js +34 -1
- package/node/lib/fbs/worker/close-router-request.js +34 -1
- package/node/lib/fbs/worker/close-web-rtc-server-request.js +34 -1
- package/node/lib/fbs/worker/create-router-request.js +34 -1
- package/node/lib/fbs/worker/create-web-rtc-server-request.js +34 -1
- package/node/lib/fbs/worker/dump-response.js +34 -1
- package/node/lib/fbs/worker/resource-usage-response.js +34 -1
- package/node/lib/fbs/worker/update-settings-request.js +34 -1
- package/node/lib/index.d.ts +1 -1
- package/node/lib/index.d.ts.map +1 -1
- package/node/lib/index.js +37 -5
- package/node/lib/ortc.js +36 -3
- package/node/lib/rtpParametersFbsUtils.js +34 -1
- package/node/lib/rtpStreamStatsFbsUtils.js +35 -2
- package/node/lib/sctpParametersFbsUtils.d.ts +2 -2
- package/node/lib/sctpParametersFbsUtils.d.ts.map +1 -1
- package/node/lib/sctpParametersFbsUtils.js +44 -7
- package/node/lib/sctpParametersTypes.d.ts +10 -46
- package/node/lib/sctpParametersTypes.d.ts.map +1 -1
- package/node/lib/srtpParametersFbsUtils.js +34 -1
- package/node/lib/test/test-ActiveSpeakerObserver.js +35 -2
- package/node/lib/test/test-AudioLevelObserver.js +35 -2
- package/node/lib/test/test-Consumer.js +37 -4
- package/node/lib/test/test-DataConsumer.js +35 -2
- package/node/lib/test/test-DataProducer.js +35 -2
- package/node/lib/test/test-DirectTransport.js +36 -8
- package/node/lib/test/test-PipeTransport.js +35 -2
- package/node/lib/test/test-PlainTransport.js +45 -12
- package/node/lib/test/test-Producer.js +37 -4
- package/node/lib/test/test-Router.js +35 -2
- package/node/lib/test/test-WebRtcServer.js +34 -1
- package/node/lib/test/test-WebRtcTransport.js +51 -22
- package/node/lib/test/test-Worker.js +37 -4
- package/node/lib/test/test-mediasoup.js +36 -3
- package/node/lib/test/test-multiopus.js +35 -2
- package/node/lib/test/test-ortc.js +34 -1
- package/node/lib/test/test-werift-sctp.js +39 -5
- package/npm-scripts.mjs +2 -2
- package/package.json +13 -11
- package/worker/deps/libwebrtc/LICENSE +5 -0
- package/worker/deps/libwebrtc/README.md +3 -3
- package/worker/deps/libwebrtc/libwebrtc/mediasoup_helpers.h +13 -10
- package/worker/fbs/dataConsumer.fbs +7 -2
- package/worker/fbs/dataProducer.fbs +1 -0
- package/worker/fbs/notification.fbs +2 -0
- package/worker/fbs/sctpAssociation.fbs +4 -0
- package/worker/fbs/sctpParameters.fbs +5 -12
- package/worker/fbs/transport.fbs +12 -8
- package/worker/fuzzer/src/RTC/FuzzerDtlsTransport.cpp +13 -3
- package/worker/fuzzer/src/RTC/FuzzerRateCalculator.cpp +2 -2
- package/worker/fuzzer/src/RTC/FuzzerSeqManager.cpp +1 -1
- package/worker/fuzzer/src/RTC/FuzzerTrendCalculator.cpp +5 -5
- package/worker/fuzzer/src/RTC/ICE/FuzzerStunPacket.cpp +9 -6
- package/worker/fuzzer/src/RTC/RTP/FuzzerRetransmissionBuffer.cpp +1 -1
- package/worker/fuzzer/src/RTC/RTP/FuzzerRtpStreamSend.cpp +14 -2
- package/worker/fuzzer/src/RTC/SCTP/association/FuzzerStateCookie.cpp +1 -1
- package/worker/fuzzer/src/RTC/SCTP/packet/FuzzerPacket.cpp +5 -2
- package/worker/fuzzer/src/fuzzer.cpp +3 -10
- package/worker/include/Channel/ChannelMessageRegistrator.hpp +39 -0
- package/worker/include/Channel/ChannelMessageRegistratorInterface.hpp +32 -0
- package/worker/include/Channel/ChannelRequest.hpp +1 -1
- package/worker/include/Channel/ChannelSocket.hpp +1 -1
- package/worker/include/DepLibUV.hpp +1 -1
- package/worker/include/DepLibUring.hpp +3 -3
- package/worker/include/Logger.hpp +4 -4
- package/worker/include/MediaSoupErrors.hpp +1 -1
- package/worker/include/RTC/ActiveSpeakerObserver.hpp +11 -9
- package/worker/include/RTC/AudioLevelObserver.hpp +7 -7
- package/worker/include/RTC/Consumer.hpp +3 -3
- package/worker/include/RTC/DataConsumer.hpp +13 -17
- package/worker/include/RTC/DataProducer.hpp +6 -9
- package/worker/include/RTC/DirectTransport.hpp +4 -6
- package/worker/include/RTC/DtlsTransport.hpp +13 -11
- package/worker/include/RTC/ICE/IceServer.hpp +8 -5
- package/worker/include/RTC/ICE/StunPacket.hpp +1 -1
- package/worker/include/RTC/KeyFrameRequestManager.hpp +15 -12
- package/worker/include/RTC/NackGenerator.hpp +8 -6
- package/worker/include/RTC/PipeConsumer.hpp +1 -2
- package/worker/include/RTC/PipeTransport.hpp +4 -6
- package/worker/include/RTC/PlainTransport.hpp +4 -6
- package/worker/include/RTC/PortManager.hpp +1 -1
- package/worker/include/RTC/Producer.hpp +3 -3
- package/worker/include/RTC/RTCP/FeedbackPs.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackRtp.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackRtpNack.hpp +1 -1
- package/worker/include/RTC/RTCP/ReceiverReport.hpp +1 -1
- package/worker/include/RTC/RTP/Packet.hpp +2 -2
- package/worker/include/RTC/RTP/RtpStream.hpp +17 -12
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +8 -6
- package/worker/include/RTC/RTP/RtpStreamSend.hpp +4 -1
- package/worker/include/RTC/RTP/RtxStream.hpp +3 -1
- package/worker/include/RTC/RTP/SharedPacket.hpp +1 -1
- package/worker/include/RTC/RateCalculator.hpp +5 -2
- package/worker/include/RTC/Router.hpp +7 -8
- package/worker/include/RTC/RtpObserver.hpp +3 -3
- package/worker/include/RTC/SCTP/association/Association.hpp +53 -19
- package/worker/include/RTC/SCTP/association/AssociationListenerDeferrer.hpp +14 -6
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +18 -14
- package/worker/include/RTC/SCTP/association/PacketSender.hpp +3 -3
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +1 -1
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +49 -35
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +114 -31
- package/worker/include/RTC/SCTP/association/{TCBContext.hpp → TransmissionControlBlockContextInterface.hpp} +14 -8
- package/worker/include/RTC/SCTP/packet/Chunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/TLV.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/UserData.hpp +61 -17
- package/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +9 -9
- package/worker/include/RTC/SCTP/packet/chunks/AnyInitChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +4 -2
- package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +4 -2
- package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +10 -3
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +22 -2
- package/worker/include/RTC/SCTP/public/{AssociationListener.hpp → AssociationListenerInterface.hpp} +5 -5
- package/worker/include/RTC/SCTP/public/Message.hpp +26 -10
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +28 -19
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +21 -0
- package/worker/include/RTC/SCTP/rx/DataTracker.hpp +277 -0
- package/worker/include/RTC/SCTP/rx/InterleavedReassemblyStreams.hpp +116 -0
- package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +202 -0
- package/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp +83 -0
- package/worker/include/RTC/SCTP/rx/TraditionalReassemblyStreams.hpp +183 -0
- package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +595 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +3 -3
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +329 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +11 -10
- package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +356 -0
- package/worker/include/RTC/SCTP/tx/SendQueueInterface.hpp +180 -0
- package/worker/include/RTC/SCTP/tx/StreamScheduler.hpp +235 -0
- package/worker/include/RTC/SenderBandwidthEstimator.hpp +5 -1
- package/worker/include/RTC/Serializable.hpp +11 -3
- package/worker/include/RTC/SimpleConsumer.hpp +1 -2
- package/worker/include/RTC/SimulcastConsumer.hpp +1 -2
- package/worker/include/RTC/SvcConsumer.hpp +1 -2
- package/worker/include/RTC/TcpServer.hpp +2 -2
- package/worker/include/RTC/Transport.hpp +65 -86
- package/worker/include/RTC/TransportCongestionControlClient.hpp +8 -5
- package/worker/include/RTC/TransportCongestionControlServer.hpp +8 -5
- package/worker/include/RTC/TransportTuple.hpp +1 -1
- package/worker/include/RTC/UdpSocket.hpp +1 -1
- package/worker/include/RTC/WebRtcServer.hpp +3 -3
- package/worker/include/RTC/WebRtcTransport.hpp +5 -7
- package/worker/include/Settings.hpp +2 -3
- package/worker/include/Shared.hpp +64 -0
- package/worker/include/SharedInterface.hpp +77 -0
- package/worker/include/Utils/UnwrappedSequenceNumber.hpp +270 -0
- package/worker/include/Utils.hpp +10 -4
- package/worker/include/Worker.hpp +6 -6
- package/worker/include/common.hpp +12 -12
- package/worker/include/handles/BackoffTimerHandle.hpp +28 -67
- package/worker/include/handles/BackoffTimerHandleInterface.hpp +123 -0
- package/worker/include/handles/TimerHandle.hpp +29 -20
- package/worker/include/handles/TimerHandleInterface.hpp +43 -0
- package/worker/meson.build +45 -29
- package/worker/meson_options.txt +2 -1
- package/worker/mocks/include/Channel/MockChannelMessageRegistrator.hpp +45 -0
- package/worker/mocks/include/MockShared.hpp +90 -0
- package/worker/mocks/include/RTC/SCTP/association/MockAssociationListener.hpp +308 -0
- package/worker/mocks/include/RTC/SCTP/association/MockTransmissionControlBlockContext.hpp +183 -0
- package/worker/mocks/include/RTC/SCTP/tx/MockSendQueue.hpp +262 -0
- package/worker/mocks/include/handles/MockBackoffTimerHandle.hpp +153 -0
- package/worker/mocks/include/handles/MockTimerHandle.hpp +74 -0
- package/worker/mocks/include/mockTypes.hpp +15 -0
- package/worker/mocks/src/Channel/MockChannelMessageRegistrator.cpp +128 -0
- package/worker/mocks/src/MockShared.cpp +46 -0
- package/worker/mocks/src/RTC/SCTP/association/MockTransmissionControlBlockContext.cpp +39 -0
- package/worker/mocks/src/handles/MockBackoffTimerHandle.cpp +127 -0
- package/worker/scripts/clang-scripts.mjs +5 -1
- package/worker/scripts/package-lock.json +6 -7
- package/worker/src/Channel/ChannelMessageRegistrator.cpp +125 -0
- package/worker/src/Channel/ChannelSocket.cpp +3 -4
- package/worker/src/DepLibUV.cpp +1 -1
- package/worker/src/DepLibUring.cpp +3 -1
- package/worker/src/Logger.cpp +1 -1
- package/worker/src/MediaSoupErrors.cpp +2 -0
- package/worker/src/RTC/ActiveSpeakerObserver.cpp +14 -14
- package/worker/src/RTC/AudioLevelObserver.cpp +12 -10
- package/worker/src/RTC/Consumer.cpp +28 -26
- package/worker/src/RTC/DataConsumer.cpp +61 -71
- package/worker/src/RTC/DataProducer.cpp +16 -11
- package/worker/src/RTC/DirectTransport.cpp +21 -20
- package/worker/src/RTC/DtlsTransport.cpp +4 -4
- package/worker/src/RTC/ICE/IceServer.cpp +6 -5
- package/worker/src/RTC/ICE/StunPacket.cpp +1 -1
- package/worker/src/RTC/KeyFrameRequestManager.cpp +15 -15
- package/worker/src/RTC/NackGenerator.cpp +6 -6
- package/worker/src/RTC/PipeConsumer.cpp +6 -5
- package/worker/src/RTC/PipeTransport.cpp +9 -22
- package/worker/src/RTC/PlainTransport.cpp +16 -28
- package/worker/src/RTC/Producer.cpp +40 -39
- package/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsRpsi.cpp +1 -2
- package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +1 -1
- package/worker/src/RTC/RTCP/XR.cpp +1 -1
- package/worker/src/RTC/RTP/Packet.cpp +3 -1
- package/worker/src/RTC/RTP/ProbationGenerator.cpp +4 -4
- package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +1 -1
- package/worker/src/RTC/RTP/RtpStream.cpp +17 -10
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +16 -14
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +12 -9
- package/worker/src/RTC/RTP/RtxStream.cpp +7 -7
- package/worker/src/RTC/RTP/SharedPacket.cpp +3 -3
- package/worker/src/RTC/RateCalculator.cpp +1 -2
- package/worker/src/RTC/Router.cpp +61 -38
- package/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +1 -1
- package/worker/src/RTC/RtpObserver.cpp +2 -1
- package/worker/src/RTC/SCTP/LICENSE +44 -0
- package/worker/src/RTC/SCTP/association/Association.cpp +417 -411
- package/worker/src/RTC/SCTP/association/AssociationListenerDeferrer.cpp +46 -13
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +47 -43
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +8 -8
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +113 -101
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +291 -62
- package/worker/src/RTC/SCTP/packet/Chunk.cpp +5 -1
- package/worker/src/RTC/SCTP/packet/Packet.cpp +8 -1
- package/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +17 -0
- package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +25 -0
- package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +10 -7
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +21 -4
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/public/Message.cpp +8 -0
- package/worker/src/RTC/SCTP/public/SctpOptions.cpp +90 -0
- package/worker/src/RTC/SCTP/rx/DataTracker.cpp +471 -0
- package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +327 -0
- package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +288 -0
- package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +453 -0
- package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +912 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +786 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +2 -2
- package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +752 -0
- package/worker/src/RTC/SCTP/tx/StreamScheduler.cpp +257 -0
- package/worker/src/RTC/SenderBandwidthEstimator.cpp +7 -5
- package/worker/src/RTC/SimpleConsumer.cpp +11 -11
- package/worker/src/RTC/SimulcastConsumer.cpp +16 -16
- package/worker/src/RTC/SrtpSession.cpp +1 -1
- package/worker/src/RTC/SvcConsumer.cpp +16 -16
- package/worker/src/RTC/TcpConnection.cpp +1 -1
- package/worker/src/RTC/Transport.cpp +497 -563
- package/worker/src/RTC/TransportCongestionControlClient.cpp +9 -8
- package/worker/src/RTC/TransportCongestionControlServer.cpp +5 -5
- package/worker/src/RTC/WebRtcServer.cpp +5 -4
- package/worker/src/RTC/WebRtcTransport.cpp +44 -39
- package/worker/src/Settings.cpp +9 -28
- package/worker/src/Shared.cpp +35 -0
- package/worker/src/Utils/Crypto.cpp +1 -1
- package/worker/src/Utils/String.cpp +1 -1
- package/worker/src/Worker.cpp +19 -48
- package/worker/src/handles/BackoffTimerHandle.cpp +34 -21
- package/worker/src/handles/TimerHandle.cpp +5 -4
- package/worker/src/handles/UdpSocketHandle.cpp +1 -1
- package/worker/src/lib.cpp +17 -16
- package/worker/subprojects/catch2.wrap +6 -6
- package/worker/tasks.py +1 -1
- package/worker/test/include/RTC/ICE/iceCommon.hpp +8 -7
- package/worker/test/include/RTC/RTP/rtpCommon.hpp +7 -6
- package/worker/test/include/RTC/SCTP/sctpCommon.hpp +16 -10
- package/worker/test/include/catch2Macros.hpp +31 -0
- package/worker/test/src/RTC/ICE/TestStunPacket.cpp +3 -3
- package/worker/test/src/RTC/ICE/iceCommon.cpp +2 -2
- package/worker/test/src/RTC/RTP/Codecs/TestVP8.cpp +1 -1
- package/worker/test/src/RTC/RTP/Codecs/TestVP9.cpp +1 -1
- package/worker/test/src/RTC/RTP/TestPacket.cpp +3 -3
- package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +16 -9
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +38 -23
- package/worker/test/src/RTC/RTP/TestSharedPacket.cpp +1 -1
- package/worker/test/src/RTC/RTP/rtpCommon.cpp +2 -2
- package/worker/test/src/RTC/SCTP/association/TestHeartbeatHandler.cpp +292 -0
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestTransmissionControlBlock.cpp +99 -0
- package/worker/test/src/RTC/SCTP/packet/TestChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestDataChunk.cpp +77 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +35 -26
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +77 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +59 -27
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +73 -35
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/rx/TestDataTracker.cpp +1117 -0
- package/worker/test/src/RTC/SCTP/rx/TestInterleavedReassemblyStreams.cpp +565 -0
- package/worker/test/src/RTC/SCTP/rx/TestReassemblyQueue.cpp +557 -0
- package/worker/test/src/RTC/SCTP/rx/TestTraditionalReassemblyStreams.cpp +555 -0
- package/worker/test/src/RTC/SCTP/sctpCommon.cpp +2 -2
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +1248 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionErrorCounter.cpp +4 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +2218 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionTimeout.cpp +33 -33
- package/worker/test/src/RTC/SCTP/tx/TestRoundRobinSendQueue.cpp +1130 -0
- package/worker/test/src/RTC/SCTP/tx/TestStreamScheduler.cpp +721 -0
- package/worker/test/src/RTC/TestKeyFrameRequestManager.cpp +20 -30
- package/worker/test/src/RTC/TestNackGenerator.cpp +11 -8
- package/worker/test/src/RTC/TestRateCalculator.cpp +6 -7
- package/worker/test/src/RTC/TestSimpleConsumer.cpp +11 -11
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +15 -3
- package/worker/test/src/Utils/TestByte.cpp +98 -0
- package/worker/test/src/{RTC/SCTP/common → Utils}/TestUnwrappedSequenceNumber.cpp +2 -2
- package/worker/test/src/testHelpers.cpp +1 -1
- package/worker/test/src/tests.cpp +0 -12
- package/node/lib/fbs/consumer/degrade-request.d.ts +0 -30
- package/node/lib/fbs/consumer/degrade-request.d.ts.map +0 -1
- package/node/lib/fbs/consumer/degrade-request.js +0 -91
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +0 -24
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +0 -1
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.js +0 -69
- package/node/lib/fbs/producer/degrade-request.d.ts +0 -30
- package/node/lib/fbs/producer/degrade-request.d.ts.map +0 -1
- package/node/lib/fbs/producer/degrade-request.js +0 -91
- package/node/lib/fbs/worker/close-notification.d.ts +0 -18
- package/node/lib/fbs/worker/close-notification.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-notification.js +0 -45
- package/node/lib/fbs/worker/close-request.d.ts +0 -18
- package/node/lib/fbs/worker/close-request.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-request.js +0 -45
- package/node/lib/fbs/worker/close-worker-notification.d.ts +0 -18
- package/node/lib/fbs/worker/close-worker-notification.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-worker-notification.js +0 -45
- package/worker/include/ChannelMessageRegistrator.hpp +0 -30
- package/worker/include/DepUsrSCTP.hpp +0 -48
- package/worker/include/RTC/SCTP/TODO_SCTP.md +0 -43
- package/worker/include/RTC/SCTP/common/UnwrappedSequenceNumber.hpp +0 -274
- package/worker/include/RTC/SctpAssociation.hpp +0 -147
- package/worker/include/RTC/Shared.hpp +0 -23
- package/worker/src/ChannelMessageRegistrator.cpp +0 -119
- package/worker/src/DepUsrSCTP.cpp +0 -277
- package/worker/src/RTC/SctpAssociation.cpp +0 -1175
- package/worker/src/RTC/Shared.cpp +0 -23
- package/worker/subprojects/usrsctp.wrap +0 -8
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
#ifndef MS_RTC_SCTP_OUTSTANDING_DATA_HPP
|
|
2
|
+
#define MS_RTC_SCTP_OUTSTANDING_DATA_HPP
|
|
3
|
+
|
|
4
|
+
#include "common.hpp"
|
|
5
|
+
#include "RTC/SCTP/packet/Packet.hpp"
|
|
6
|
+
#include "RTC/SCTP/packet/UserData.hpp"
|
|
7
|
+
#include "RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp"
|
|
8
|
+
#include "RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp"
|
|
9
|
+
#include "RTC/SCTP/packet/chunks/SackChunk.hpp"
|
|
10
|
+
#include "RTC/SCTP/public/SctpTypes.hpp"
|
|
11
|
+
#include <deque>
|
|
12
|
+
#include <ostream>
|
|
13
|
+
#include <set>
|
|
14
|
+
#include <span>
|
|
15
|
+
#include <vector>
|
|
16
|
+
|
|
17
|
+
namespace RTC
|
|
18
|
+
{
|
|
19
|
+
namespace SCTP
|
|
20
|
+
{
|
|
21
|
+
/**
|
|
22
|
+
* This class keeps track of outstanding data Chunks (sent, not yet acked)
|
|
23
|
+
* and handles acking, nacking, rescheduling and abandoning.
|
|
24
|
+
*
|
|
25
|
+
* Items are added to this queue as they are sent and will be removed when
|
|
26
|
+
* the peer acks them using the cumulative TSN ack.
|
|
27
|
+
*/
|
|
28
|
+
class OutstandingData
|
|
29
|
+
{
|
|
30
|
+
#ifdef MS_TEST
|
|
31
|
+
public:
|
|
32
|
+
/**
|
|
33
|
+
* State for DATA Chunks (message fragments) in the queue.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* - Used in tests.
|
|
37
|
+
*/
|
|
38
|
+
enum class State : uint8_t
|
|
39
|
+
{
|
|
40
|
+
/**
|
|
41
|
+
* The Chunk has been sent but not received yet (from the sender's point
|
|
42
|
+
* of view, as no SACK has been received yet that reference this Chunk).
|
|
43
|
+
*/
|
|
44
|
+
IN_FLIGHT,
|
|
45
|
+
/**
|
|
46
|
+
* A SACK has been received which explicitly marked this Chunk as missing.
|
|
47
|
+
* It's now NACKED and may be retransmitted if NACKED enough times.
|
|
48
|
+
*/
|
|
49
|
+
NACKED,
|
|
50
|
+
/**
|
|
51
|
+
* A Chunk that will be retransmitted when possible.
|
|
52
|
+
*/
|
|
53
|
+
TO_BE_RETRANSMITTED,
|
|
54
|
+
/**
|
|
55
|
+
* A SACK has been received which explicitly marked this Chunk as
|
|
56
|
+
* received.
|
|
57
|
+
*/
|
|
58
|
+
ACKED,
|
|
59
|
+
/**
|
|
60
|
+
* A Chunk whose message has expired or has been retransmitted too many
|
|
61
|
+
* times (RFC3758). It will not be retransmitted anymore.
|
|
62
|
+
*/
|
|
63
|
+
ABANDONED,
|
|
64
|
+
};
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
public:
|
|
68
|
+
/**
|
|
69
|
+
* Contains variables scoped to a processing of an incoming SACK.
|
|
70
|
+
*/
|
|
71
|
+
struct AckInfo
|
|
72
|
+
{
|
|
73
|
+
explicit AckInfo(Types::UnwrappedTsn cumulativeTsnAck) : highestTsnAcked(cumulativeTsnAck)
|
|
74
|
+
{
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Bytes acked by increasing `cumulativeTsnAck` and `gapAckBlocks`.
|
|
79
|
+
*/
|
|
80
|
+
size_t bytesAcked{ 0 };
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Indicates if this SACK indicates that packet loss has occurred. Just
|
|
84
|
+
* because a packet is missing in the SACK doesn't necessarily mean that
|
|
85
|
+
* there is packet loss as that packet might be in-flight and received
|
|
86
|
+
* out-of-order. But when it has been reported missing consecutive
|
|
87
|
+
* times, it will eventually be considered "lost" and this will be set.
|
|
88
|
+
*/
|
|
89
|
+
bool hasPacketLoss{ false };
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Highest TSN Newly Acknowledged, an SCTP variable.
|
|
93
|
+
*/
|
|
94
|
+
Types::UnwrappedTsn highestTsnAcked;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The set of lifecycle IDs that were acked using `cumulativeTsnAck`.
|
|
98
|
+
*/
|
|
99
|
+
std::vector<uint64_t> ackedLifecycleIds;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The set of lifecycle IDs that were acked, but had been abandoned.
|
|
103
|
+
*/
|
|
104
|
+
std::vector<uint64_t> abandonedLifecycleIds;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
private:
|
|
108
|
+
/**
|
|
109
|
+
* A fragmented message's DATA Chunk while in the retransmission queue,
|
|
110
|
+
* and its associated metadata.
|
|
111
|
+
*
|
|
112
|
+
* @remarks
|
|
113
|
+
* - This data structure has been optimized for size, by ordering fields
|
|
114
|
+
* to avoid unnecessary padding.
|
|
115
|
+
*/
|
|
116
|
+
class Item
|
|
117
|
+
{
|
|
118
|
+
public:
|
|
119
|
+
enum class NackAction : uint8_t
|
|
120
|
+
{
|
|
121
|
+
NOTHING,
|
|
122
|
+
RETRANSMIT,
|
|
123
|
+
ABANDON,
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
private:
|
|
127
|
+
private:
|
|
128
|
+
enum class Lifecycle : uint8_t
|
|
129
|
+
{
|
|
130
|
+
/**
|
|
131
|
+
* The Chunk is alive (sent, received, etc).
|
|
132
|
+
*/
|
|
133
|
+
ACTIVE,
|
|
134
|
+
/**
|
|
135
|
+
* The Chunk is scheduled to be retransmitted, and will then
|
|
136
|
+
* transition to become active.
|
|
137
|
+
*/
|
|
138
|
+
TO_BE_RETRANSMITTED,
|
|
139
|
+
/**
|
|
140
|
+
* The Chunk has been abandoned. This is a terminal state.
|
|
141
|
+
*/
|
|
142
|
+
ABANDONED
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
enum class AckState : uint8_t
|
|
146
|
+
{
|
|
147
|
+
/**
|
|
148
|
+
* The Chunk is in-flight.
|
|
149
|
+
*/
|
|
150
|
+
UNACKED,
|
|
151
|
+
/**
|
|
152
|
+
* The Chunk has been received and acknowledged.
|
|
153
|
+
*/
|
|
154
|
+
ACKED,
|
|
155
|
+
/**
|
|
156
|
+
* The Chunk has been nacked and is possibly lost.
|
|
157
|
+
*/
|
|
158
|
+
NACKED
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
public:
|
|
162
|
+
Item(
|
|
163
|
+
uint32_t outgoingMessageId,
|
|
164
|
+
UserData data,
|
|
165
|
+
uint64_t timeSentMs,
|
|
166
|
+
uint16_t maxRetransmissions,
|
|
167
|
+
uint64_t expiresAtMs,
|
|
168
|
+
std::optional<uint64_t> lifecycleId);
|
|
169
|
+
|
|
170
|
+
Item(const Item&) = delete;
|
|
171
|
+
|
|
172
|
+
Item& operator=(const Item&) = delete;
|
|
173
|
+
|
|
174
|
+
public:
|
|
175
|
+
uint32_t GetOutgoingMessageId() const
|
|
176
|
+
{
|
|
177
|
+
return this->outgoingMessageId;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
uint64_t GetTimeSentMs() const
|
|
181
|
+
{
|
|
182
|
+
return this->timeSentMs;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const UserData& GetData() const
|
|
186
|
+
{
|
|
187
|
+
return this->data;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Acks an item.
|
|
192
|
+
*/
|
|
193
|
+
void Ack();
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Nacks an item. If it has been nacked enough times, or if
|
|
197
|
+
* `retransmitNow` is set, it might be marked for retransmission. If
|
|
198
|
+
* the item has reached its max retransmission value, it will instead
|
|
199
|
+
* be abandoned. The action performed is indicated as return value.
|
|
200
|
+
*/
|
|
201
|
+
NackAction Nack(bool retransmitNow);
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Prepares the item to be retransmitted. Sets it as outstanding and
|
|
205
|
+
* clears all nack counters.
|
|
206
|
+
*/
|
|
207
|
+
void MarkAsRetransmitted();
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Marks this item as abandoned.
|
|
211
|
+
*/
|
|
212
|
+
void Abandon();
|
|
213
|
+
|
|
214
|
+
bool IsOutstanding() const
|
|
215
|
+
{
|
|
216
|
+
return this->ackState != AckState::ACKED && this->lifecycle == Lifecycle::ACTIVE;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
bool IsAcked() const
|
|
220
|
+
{
|
|
221
|
+
return this->ackState == AckState::ACKED;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
bool IsNacked() const
|
|
225
|
+
{
|
|
226
|
+
return this->ackState == AckState::NACKED;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
bool IsAbandoned() const
|
|
230
|
+
{
|
|
231
|
+
return this->lifecycle == Lifecycle::ABANDONED;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Indicates if this Chunk should be retransmitted.
|
|
236
|
+
*/
|
|
237
|
+
bool ShouldBeRetransmitted() const
|
|
238
|
+
{
|
|
239
|
+
return this->lifecycle == Lifecycle::TO_BE_RETRANSMITTED;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Indicates if this Chunk has ever been retransmitted.
|
|
244
|
+
*/
|
|
245
|
+
bool HasBeenRetransmitted() const
|
|
246
|
+
{
|
|
247
|
+
return this->numRetransmissions > 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Given the current time, and the current state of this DATA Chunk, it
|
|
252
|
+
* will indicate if it has expired (SCTP Partial Reliability Extension).
|
|
253
|
+
*/
|
|
254
|
+
bool HasExpired(uint64_t nowMs) const
|
|
255
|
+
{
|
|
256
|
+
return (this->expiresAtMs != Types::ExpiresAtMsInfinite && this->expiresAtMs <= nowMs);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
std::optional<uint64_t> GetLifecycleId() const
|
|
260
|
+
{
|
|
261
|
+
return this->lifecycleId;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
const uint32_t outgoingMessageId;
|
|
265
|
+
// The actual data to send/retransmit.
|
|
266
|
+
const UserData data;
|
|
267
|
+
// When the packet was sent, and placed in this queue.
|
|
268
|
+
const uint64_t timeSentMs;
|
|
269
|
+
// If the message was sent with a maximum number of retransmissions,
|
|
270
|
+
// this is set to that number. The value zero (0) means that it will
|
|
271
|
+
// never be retransmitted.
|
|
272
|
+
const uint16_t maxRetransmissions;
|
|
273
|
+
// At this exact millisecond, the item is considered expired. If the
|
|
274
|
+
// message is not to be expired, this is set to the infinite future.
|
|
275
|
+
// NOTE: If 0 it means infinite time.
|
|
276
|
+
const uint64_t expiresAtMs;
|
|
277
|
+
// An optional lifecycle id, which may only be set for the last
|
|
278
|
+
// fragment.
|
|
279
|
+
const std::optional<uint64_t> lifecycleId;
|
|
280
|
+
// Indicates the life cycle status of this Chunk.
|
|
281
|
+
Lifecycle lifecycle{ Lifecycle::ACTIVE };
|
|
282
|
+
// Indicates the presence of this Chunk, if it's in flight (UNACKED),
|
|
283
|
+
// has been received (ACKED) or is possibly lost (NACKED).
|
|
284
|
+
AckState ackState{ AckState::UNACKED };
|
|
285
|
+
// The number of times the DATA Chunk has been nacked (by having
|
|
286
|
+
// received a SACK which doesn't include it). Will be cleared on
|
|
287
|
+
// retransmissions.
|
|
288
|
+
uint8_t nackCount{ 0 };
|
|
289
|
+
// The number of times the DATA Chunk has been retransmitted.
|
|
290
|
+
uint16_t numRetransmissions{ 0 };
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
public:
|
|
294
|
+
OutstandingData(
|
|
295
|
+
size_t dataChunkHeaderLength,
|
|
296
|
+
Types::UnwrappedTsn lastCumulativeTsnAck,
|
|
297
|
+
std::function<bool(uint16_t /*streamId*/, uint32_t /*outgoingMessageId*/)> discardFromSendQueue);
|
|
298
|
+
|
|
299
|
+
public:
|
|
300
|
+
AckInfo HandleSack(
|
|
301
|
+
Types::UnwrappedTsn cumulativeTsnAck,
|
|
302
|
+
std::span<const SackChunk::GapAckBlock> gapAckBlocks,
|
|
303
|
+
bool isInFastRecovery);
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Returns as many of the Chunks that are eligible for fast retransmissions
|
|
307
|
+
* and that would fit in a single packet of `maxLength`. The eligible
|
|
308
|
+
* Chunks that didn't fit will be marked for (normal) retransmission and
|
|
309
|
+
* will not be returned if this method is called again.
|
|
310
|
+
*/
|
|
311
|
+
std::vector<std::pair<uint32_t /*tsn*/, UserData>> GetChunksToBeFastRetransmitted(size_t maxLength);
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Given `maxLength` of space left in a packet, which Chunks can be added
|
|
315
|
+
* to it?
|
|
316
|
+
*/
|
|
317
|
+
std::vector<std::pair<uint32_t /*tsn*/, UserData>> GetChunksToBeRetransmitted(size_t maxLength);
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* How many inflight bytes there are, as sent on the wire as packets.
|
|
321
|
+
*/
|
|
322
|
+
size_t GetUnackedPacketBytes() const
|
|
323
|
+
{
|
|
324
|
+
return this->unackedPacketBytes;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* How many inflight bytes there are, counting only the payload.
|
|
329
|
+
*/
|
|
330
|
+
size_t GetUnackedPayloadBytes() const
|
|
331
|
+
{
|
|
332
|
+
return this->unackedPayloadBytes;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Returns the number of DATA Chunks that are in-flight (not acked or
|
|
337
|
+
* nacked).
|
|
338
|
+
*/
|
|
339
|
+
size_t GetUnackedItems() const
|
|
340
|
+
{
|
|
341
|
+
return this->unackedItems;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Given the current time `nowMs`, expire and abandon outstanding (sent
|
|
346
|
+
* at least once) Chunks that have a limited lifetime.
|
|
347
|
+
*/
|
|
348
|
+
void ExpireOutstandingChunks(uint64_t nowMs);
|
|
349
|
+
|
|
350
|
+
bool IsEmpty() const
|
|
351
|
+
{
|
|
352
|
+
return this->outstandingData.empty();
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
bool HasDataToBeFastRetransmitted() const
|
|
356
|
+
{
|
|
357
|
+
return !this->toBeFastRetransmitted.empty();
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
bool HasDataToBeRetransmitted() const
|
|
361
|
+
{
|
|
362
|
+
return !this->toBeRetransmitted.empty() || !this->toBeFastRetransmitted.empty();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
Types::UnwrappedTsn GetLastCumulativeTsnAck() const
|
|
366
|
+
{
|
|
367
|
+
return this->lastCumulativeTsnAck;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
Types::UnwrappedTsn GetNextTsn() const
|
|
371
|
+
{
|
|
372
|
+
return this->GetHighestOutstandingTsn().GetNextValue();
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
Types::UnwrappedTsn GetHighestOutstandingTsn() const;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Schedules `data` to be sent, with the provided partial reliability
|
|
379
|
+
* parameters. Returns the TSN if the item was actually added and
|
|
380
|
+
* scheduled to be sent, and std::nullopt if it shouldn't be sent.
|
|
381
|
+
*/
|
|
382
|
+
std::optional<Types::UnwrappedTsn> Insert(
|
|
383
|
+
uint32_t outgoingMessageId,
|
|
384
|
+
const UserData& data,
|
|
385
|
+
uint64_t timeSentMs,
|
|
386
|
+
uint16_t maxRetransmissions = Types::MaxRetransmitsNoLimit,
|
|
387
|
+
uint64_t expiresAtMs = Types::ExpiresAtMsInfinite,
|
|
388
|
+
std::optional<uint64_t> lifecycleId = std::nullopt);
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Nacks all outstanding data.
|
|
392
|
+
*/
|
|
393
|
+
void NackAll();
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Adds a FORWARD-TSN Chunk to the given Packet and returns it.
|
|
397
|
+
*/
|
|
398
|
+
const ForwardTsnChunk* AddForwardTsn(Packet* packet) const;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Adds an I-FORWARD-TSN Chunk to the given Packet and returns it.
|
|
402
|
+
*/
|
|
403
|
+
const IForwardTsnChunk* AddIForwardTsn(Packet* packet) const;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Given the current time and a TSN, it returns the measured RTT between
|
|
407
|
+
* when the Chunk was sent and now. It takes into acccount Karn's
|
|
408
|
+
* algorithm, so if the Chunk has ever been retransmitted, it will return
|
|
409
|
+
* `std::nullopt`.
|
|
410
|
+
*/
|
|
411
|
+
std::optional<uint64_t> MeasureRtt(uint64_t nowMs, Types::UnwrappedTsn tsn) const;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Returns true if the next Chunk that is not acked by the peer has been
|
|
415
|
+
* abandoned, which means that a FORWARD-TSN should be sent.
|
|
416
|
+
*/
|
|
417
|
+
bool ShouldSendForwardTsn() const;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Called when an outgoing stream reset is sent, marking the last assigned
|
|
421
|
+
* TSN as a breakpoint that a FORWARD-TSN shouldn't cross.
|
|
422
|
+
*/
|
|
423
|
+
void BeginResetStreams();
|
|
424
|
+
|
|
425
|
+
#ifdef MS_TEST
|
|
426
|
+
/**
|
|
427
|
+
* Returns the internal state of all queued Chunks.
|
|
428
|
+
*
|
|
429
|
+
* @remarks
|
|
430
|
+
* - Used in tests.
|
|
431
|
+
*/
|
|
432
|
+
std::vector<std::pair<uint32_t /*tsn*/, State>> GetChunkStatesForTesting() const;
|
|
433
|
+
#endif
|
|
434
|
+
|
|
435
|
+
private:
|
|
436
|
+
/**
|
|
437
|
+
* Returns how large a Chunk will be, serialized, carrying the data.
|
|
438
|
+
*/
|
|
439
|
+
size_t GetSerializedChunkLength(const UserData& data) const;
|
|
440
|
+
|
|
441
|
+
Item& GetItem(Types::UnwrappedTsn tsn);
|
|
442
|
+
|
|
443
|
+
const Item& GetItem(Types::UnwrappedTsn tsn) const;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Given a `cumulativeTsnAck` from an incoming SACK, will remove those
|
|
447
|
+
* items in the retransmission queue up until this value and will update
|
|
448
|
+
* `ackInfo` by setting `this->lastCumulativeTsnAck`.
|
|
449
|
+
*/
|
|
450
|
+
void RemoveAcked(Types::UnwrappedTsn cumulativeTsnAck, AckInfo& ackInfo);
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Will mark the Chunks covered by the `gapAckBlocks` from an incoming
|
|
454
|
+
* SACK as "acked" and update `ackInfo` by adding new TSNs to
|
|
455
|
+
* `this->cumulativeTsnAck`.
|
|
456
|
+
*/
|
|
457
|
+
void AckGapBlocks(
|
|
458
|
+
Types::UnwrappedTsn cumulativeTsnAck,
|
|
459
|
+
std::span<const SackChunk::GapAckBlock> gapAckBlocks,
|
|
460
|
+
AckInfo& ackInfo);
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Mark Chunks reported as "missing", as "nacked" or "to be retransmitted"
|
|
464
|
+
* depending how many times this has happened. Only packets up until
|
|
465
|
+
* `ackInfo.highestTsnAcked` (highest TSN newly acknowledged) are
|
|
466
|
+
* nacked/retransmitted. The method will set `ackInfo.hasPacketLoss`.
|
|
467
|
+
*/
|
|
468
|
+
void NackBetweenAckBlocks(
|
|
469
|
+
Types::UnwrappedTsn cumulativeTsnAck,
|
|
470
|
+
std::span<const SackChunk::GapAckBlock> gapAckBlocks,
|
|
471
|
+
bool isInFastRecovery,
|
|
472
|
+
bool cumulativeTsnAckedAdvanced,
|
|
473
|
+
AckInfo& ackInfo);
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Process the acknowledgement of the Chunk referenced by `item` and
|
|
477
|
+
* updates state in `ackInfo` and the object's state.
|
|
478
|
+
*/
|
|
479
|
+
void AckChunk(AckInfo& ackInfo, Types::UnwrappedTsn tsn, Item& item);
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Helper method to process an incoming nack of an item and perform the
|
|
483
|
+
* correct operations given the action indicated when nacking an item
|
|
484
|
+
* (e.g. retransmitting or abandoning). The return value indicate if an
|
|
485
|
+
* action was performed, meaning that packet loss was detected and acted
|
|
486
|
+
* upon. If `doFastRetransmit` is set and if the item has been nacked
|
|
487
|
+
* sufficiently many times so that it should be retransmitted, this will
|
|
488
|
+
* schedule it to be "fast retransmitted". This is only done just before
|
|
489
|
+
* going into fast recovery.
|
|
490
|
+
*
|
|
491
|
+
* @remarks
|
|
492
|
+
* - Note that since nacking an item may result in it becoming abandoned,
|
|
493
|
+
* which in turn could alter `this->outstandingData`, any iterators are
|
|
494
|
+
* invalidated after having called this method.
|
|
495
|
+
*/
|
|
496
|
+
bool NackItem(Types::UnwrappedTsn tsn, bool retransmitNow, bool doFastRetransmit);
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Given that a message fragment, `item` has been abandoned, abandon all
|
|
500
|
+
* other fragments that share the same message - both never-before-sent
|
|
501
|
+
* fragments that are still in the SendQueue and outstanding Chunks.
|
|
502
|
+
*/
|
|
503
|
+
void AbandonAllFor(const OutstandingData::Item& item);
|
|
504
|
+
|
|
505
|
+
std::vector<std::pair<uint32_t /*tsn*/, UserData>> ExtractChunksThatCanFit(
|
|
506
|
+
std::set<Types::UnwrappedTsn>& chunks, size_t maxLength);
|
|
507
|
+
|
|
508
|
+
void AssertIsConsistent() const;
|
|
509
|
+
|
|
510
|
+
private:
|
|
511
|
+
// The size of the data Chunk (DATA/I-DATA) header that is used.
|
|
512
|
+
const size_t dataChunkHeaderLength;
|
|
513
|
+
// The last cumulative TSN ack number.
|
|
514
|
+
Types::UnwrappedTsn lastCumulativeTsnAck;
|
|
515
|
+
// Callback when to discard items from the send queue.
|
|
516
|
+
std::function<bool(uint16_t /*streamId*/, uint32_t /*outgoingMessageId*/)> discardFromSendQueue;
|
|
517
|
+
// Outstanding items. If non-empty, the first element has
|
|
518
|
+
// `TSN=this->lastCumulativeTsnAck_ + 1` and the following items are in
|
|
519
|
+
// strict increasing TSN order. The last item has
|
|
520
|
+
// `TSN=GetHighestOutstandingTsn()`.
|
|
521
|
+
std::deque<Item> outstandingData;
|
|
522
|
+
// The number of bytes that are in-flight, counting only the payload.
|
|
523
|
+
size_t unackedPayloadBytes{ 0 };
|
|
524
|
+
// The number of bytes that are in-flight, as sent on the wire (as
|
|
525
|
+
// packets).
|
|
526
|
+
size_t unackedPacketBytes{ 0 };
|
|
527
|
+
// The number of DATA Chunks that are in-flight (sent but not yet acked
|
|
528
|
+
// or nacked).
|
|
529
|
+
size_t unackedItems{ 0 };
|
|
530
|
+
// Data Chunks that are eligible for fast retransmission.
|
|
531
|
+
std::set<Types::UnwrappedTsn> toBeFastRetransmitted;
|
|
532
|
+
// Data Chunks that are to be retransmitted.
|
|
533
|
+
std::set<Types::UnwrappedTsn> toBeRetransmitted;
|
|
534
|
+
// Wben a stream reset has begun, the "next TSN to assign" is added to
|
|
535
|
+
// this set, and removed when the cum-ack TSN reaches it. This is used
|
|
536
|
+
// to limit a FORWARD-TSN to reset streams past a "stream reset last
|
|
537
|
+
// assigned TSN".
|
|
538
|
+
// NOTE: dcsctp uses `webrtc::flat_set<UnwrappedTSN>` type which is more
|
|
539
|
+
// efficient in read operations.
|
|
540
|
+
std::set<Types::UnwrappedTsn> streamResetBreakpointTsns;
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
#ifdef MS_TEST
|
|
544
|
+
/**
|
|
545
|
+
* For logging purposes in Catch2 tests.
|
|
546
|
+
*/
|
|
547
|
+
inline std::ostream& operator<<(std::ostream& os, OutstandingData::State state)
|
|
548
|
+
{
|
|
549
|
+
switch (state)
|
|
550
|
+
{
|
|
551
|
+
case OutstandingData::State::IN_FLIGHT:
|
|
552
|
+
{
|
|
553
|
+
return os << "IN_FLIGHT";
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
case OutstandingData::State::NACKED:
|
|
557
|
+
{
|
|
558
|
+
return os << "NACKED";
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
case OutstandingData::State::TO_BE_RETRANSMITTED:
|
|
562
|
+
{
|
|
563
|
+
return os << "TO_BE_RETRANSMITTED";
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
case OutstandingData::State::ACKED:
|
|
567
|
+
{
|
|
568
|
+
return os << "ACKED";
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
case OutstandingData::State::ABANDONED:
|
|
572
|
+
{
|
|
573
|
+
return os << "ABANDONED";
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
default:
|
|
577
|
+
{
|
|
578
|
+
return os << "UNKNOWN(" << static_cast<int>(state) << ")";
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* For Catch2 to print it nicely.
|
|
585
|
+
*/
|
|
586
|
+
inline std::ostream& operator<<(
|
|
587
|
+
std::ostream& os, const std::pair<uint32_t, OutstandingData::State>& s)
|
|
588
|
+
{
|
|
589
|
+
return os << "{tsn:" << s.first << ", state:" << s.second << "}";
|
|
590
|
+
}
|
|
591
|
+
#endif
|
|
592
|
+
} // namespace SCTP
|
|
593
|
+
} // namespace RTC
|
|
594
|
+
|
|
595
|
+
#endif
|
|
@@ -26,8 +26,8 @@ namespace RTC
|
|
|
26
26
|
void Dump(int indentation = 0) const;
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* Increments the retransmission timer.
|
|
30
|
-
* been reached, `false` will be returned.
|
|
29
|
+
* Increments the retransmission timer. Returns `true` if the maximum
|
|
30
|
+
* error count has been reached, `false` will be returned.
|
|
31
31
|
*/
|
|
32
32
|
bool Increment(std::string_view reason);
|
|
33
33
|
|
|
@@ -54,7 +54,7 @@ namespace RTC
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
private:
|
|
57
|
-
std::optional<
|
|
57
|
+
std::optional<uint16_t> limit;
|
|
58
58
|
size_t counter{ 0 };
|
|
59
59
|
};
|
|
60
60
|
} // namespace SCTP
|