Reputation: 5656
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...)
Upvotes: 9
Views: 4583
Reputation: 9429
Linux: available since version 2.6.4
Mac OS: not available (better source?)
Windows: not available
Upvotes: 0
Reputation: 1288
SCTP is still not available on Mac OS X (El Captain). There is a 3rd party open-source kernel extension at https://github.com/sctplab/SCTP_NKE_ElCapitan - But it is unsigned, therefore you have to disable Apple System Integrity Protection.
See e.g. https://apple.stackexchange.com/questions/114217/sctp-kernel-extension-for-mavericks
Equally, you cannot use SOCK_SEQPACKET with AF_UNIX on Mac OS X too.
Upvotes: 1
Reputation: 8466
I you uses SOCK_SEQPACKET
of AF_INET
, this way:
socket(AF_INET, SOCK_SEQPACKET, 0);
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.
Upvotes: 8