在 Linux 上使用 AF_LOCAL 或 AF_UNIX 套接字进行多播?

Multicast with AF_LOCAL or AF_UNIX sockets on Linux?

是否可以在 Linux 上的 AF_UNIX SOCK_DGRAM 套接字上进行多播通信?

显然 a patch was proposed over a decade ago。但是,我无法在 Internet 上找到任何显示其用法的资源。而下面的简单代码报告Operation not supported.

u_int yes = 1;
int fd = socket(AF_LOCAL, SOCK_DGRAM, 0);
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));

您提到的补丁从未应用过。

您不能在 AF_UNIX 套接字上进行多播,至少在 linux 上,SO_REUSEADDR 对 [=14= 没有任何意义(未实现) ]套接字。