Unix socket, SOCK_SEQPACKET vs SOCK_DGRAM

前端 未结 5 1991
一生所求
一生所求 2021-02-01 12:36

It seems there\'s atleast 3 different local/unix socket types (AF_UNIX) , SOCK_STREAM, SOCK_DGRAM and SOCK_SEQPACKET.

<
5条回答
  •  我在风中等你
    2021-02-01 12:55

    SOCK_SEQPACKET gives you the guarantees of SOCK_STREAM (i.e., preservation of ordering, guaranteed delivery, no duplication), but with delineated packet boundaries just like SOCK_DGRAM. So, basically it's a mix of the two protocol types.

    In the TCP/IP-family, SCTP implements both SOCK_STREAM (TCP-like) and SOCK_SEQPACKET. Unfortunately it is not stock-available on Windows.

提交回复
热议问题