aos/sctp: Disable interleaving
Change-Id: I69ae1e0cbc87471c902ba3ef3d7a5f34f90a9b75
diff --git a/aos/network/sctp_client.cc b/aos/network/sctp_client.cc
index dbc0387..7d86316 100644
--- a/aos/network/sctp_client.cc
+++ b/aos/network/sctp_client.cc
@@ -25,10 +25,14 @@
PCHECK(fd_ != -1);
{
- // Allow the kernel to deliver messages from different streams in any order.
- int full_interleaving = 2;
+ // Per https://tools.ietf.org/html/rfc6458
+ // Setting this to !0 allows event notifications to be interleaved
+ // with data if enabled, and would have to be handled in the code.
+ // Enabling interleaving would only matter during congestion, which
+ // typically only happens during application startup.
+ int interleaving = 0;
PCHECK(setsockopt(fd_, IPPROTO_SCTP, SCTP_FRAGMENT_INTERLEAVE,
- &full_interleaving, sizeof(full_interleaving)) == 0);
+ &interleaving, sizeof(interleaving)) == 0);
}
{