Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multicast with AF_LOCAL or AF_UNIX sockets on Linux?

Is it possible to have multicast communications on a AF_UNIX SOCK_DGRAM socket on Linux ?

Apparently a patch was proposed over a decade ago. However, I cannot find any resource on Internet showing its usage. And the following simple code reports Operation not supported.

u_int yes = 1;
int fd = socket(AF_LOCAL, SOCK_DGRAM, 0);
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));
like image 315
Claudio Avatar asked Sep 25 '22 13:09

Claudio


1 Answers

The patch you refer to was never applied.

You can't do multicast on AF_UNIX sockets, and at least on linux, SO_REUSEADDR doesn't have any meaning (it's not implemented) for AF_UNIX sockets.

like image 159
nos Avatar answered Sep 28 '22 05:09

nos