socat 是否支持 SOCK_SEQPACKET 用于 Unix 域套接字?

Does socat support SOCK_SEQPACKET for Unix domain socket?

考虑以下设置,其中 socat 的一个实例通过管道将数据从 stdin 传输到 unix 域套接字,而另一个实例从 unix 域套接字读取该数据并将其写入 stdout:

客户:

(while true; do echo "hello"; sleep 1; done) | socat STDIN UNIX:test.sock

服务器:

socat UNIX-LISTEN:test.sock STDOUT

此设置按预期工作,其中服务器以 1 秒的间隔打印 hellostdoutsocat 有没有办法使用 SOCK_SEQPACKET 套接字类型?

在进一步调查 man page 后,我了解到 SOCK_SEQPACKETsocat 支持:

socktype= Sets the type of the socket, specified as second argument to the socket() or socketpair() calls, to [int]. Address resolution is not affected by this option. Under Linux, 1 means stream oriented socket, 2 means datagram socket, 3 means raw socket, and 5 seqpacket (stream keeping packet boundaries).

客户:

(while true; do echo "hello"; sleep 1; done) | socat STDIN UNIX:test.sock,socktype=5

服务器:

socat UNIX-LISTEN:test.sock,socktype=5 STDOUT