I use an ordered set equal to true, however, when many (1000 or more) messages are sent in a short period of time (<1 second), the received messages are not all received in the same order.
rtcPeerConnection.createDataChannel("app", { ordered: true, maxPacketLifeTime: 3000 });
I could provide a minimal example to reproduce this strange behavior, if necessary.
I also use bufferedAmountLowThreshold and its related event to delay when the buffered send amount is too large. I chose 2000, but I do not know what the optimal number is. The reason I have so many messages in a short amount of time is because I don't want to overwhelm the maximum amount of data sent at one time. Therefore, I split the data into 800 byte packets and sent them. Again, I do not know what a message of maximum size 1 is.
const SEND_BUFFERED_AMOUNT_LOW_THRESHOLD = 2000;
Everything works fine for small data that is not split into too many messages. The error is executed randomly for large files only.
source share