I would look at SCTP socket API it supports multistreaming.
SCTP is very telecom-shaped; in particular, IIRC, the number of streams is fixed at the start of the connection, so (this sucks but also) GP’s problem does not appear.
I checked that out and....yuck!
- Send specifies which stream by ordinal number? (Can't have different parts of a concurrent app independently open new streams)
- Receive doesn't specify which stream at all?!
API RFC is https://datatracker.ietf.org/doc/html/draft-lxin-quic-socket...