6

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...)

4

3 に答える 3

6

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.

于 2012-11-08T11:07:05.663 に答える
1

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.

于 2016-10-02T13:36:13.693 に答える
0

Linux: available since version 2.6.4

Mac OS: not available (better source?)

Windows: not available

于 2018-05-24T21:16:29.390 に答える