Closed riedel closed 4 years ago
@riedel: What do you think about unlinking the socket path whenever SO_REUSEADDR
is set on the socket? That would pretty much mimick IP behaviour.
I think that is probably a good idea. But don't really ask me about all the semantics of SO_REUSEADDR
and SO_REUSEPORT
(here one would need to keep state across invocations). My gut feeling is that it leads to a bit of different behaviour, but it might be a sane default behaviour. I would maybe make add an option to force turning off and on this behaviour independent of the flag beeing set (After reading some considerations on UNIX socket locking and side effects I think it makes sense). The unlinking logic would be there and adding the option would add the possibility for manual override.
Would be great if one would not have to unlink all sockets manually before running a command again. Should be an explicit option due to the chance of race conditions and unwanted side effects.