Skip to content

Expose the bytes in the SCTP association's own queues and the send buffer that bounds them - #6

Draft
electronicboy wants to merge 2 commits into
opencollab-incubator:mainfrom
electronicboy:shane/sctp-send-queue-stats
Draft

electronicboy wants to merge 2 commits into
opencollab-incubator:mainfrom
electronicboy:shane/sctp-send-queue-stats

Conversation

@electronicboy

@electronicboy electronicboy commented Nov 13, 2026 •

Copy link
Copy Markdown

Exposes the three SCTP stats added in opencollab-incubator/libdatachannel#4 on SctpStats:

  • sendQueueBytes(): bytes the association has accepted for sending and not had acknowledged, sent or not. DataChannel.bufferedAmount() only counts what usrsctp would not take yet, so up to a whole send buffer (1 MiB by default) waited below it unseen.
  • sendBufferSize(): the bound on that queue, so a reader can tell how full it is and confirm SctpSettings.sendBufferSize took effect.
  • receiveQueueBytes(): received bytes awaiting reassembly or ordering, the byte counterpart of pendingChunks().

Depends on opencollab-incubator/libdatachannel#4

Testing

NativeTransportProbe now:

  • sets sendBufferSize(512 KiB) and asserts sendBufferSize() reports exactly 524288;
  • sends 32 × 16 KiB from the host and asserts the send queue holds at least one unacknowledged message, then drains to 0.

Run locally against an Mbed TLS build of the natives (no OpenSSL headers on that machine): all 15 probe scenarios pass, with peaks of 354–376 KB queued. The OpenSSL-dependent native test executables, the other probes and the release builds were not run locally.

…ffer that bounds them

Syncs jni/libdatachannel to the commit that reports them.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant