When using a raw TCP socket, there is a need for doing message framing, as explained here, either with a length prefix, or with delimiters.
I came accross the “SOCK_SEQPACKET” socket option today, which could apparently do the message framing almost transparently.
What is the availability of “SOCK_SEQPACKET” amongst platforms and OSes at the moment? (Windows, OSX, Linux, IOS, Android…)
I you uses
SOCK_SEQPACKETofAF_INET, this way:You won’t get a TCP socket. The socket will be a SCTP socket, if your platform supports it.
SCTP is not yet widely used. Latest Linux versions supports it (if SCTP is enabled).
There are some libraries also for Windows.