fix(discovery): add SO_REUSEPORT for multiple mDNS listeners

This commit is contained in:
Voxis 2026-02-16 15:53:35 +01:00
parent 33a8c939ee
commit 590e429630
Signed by: markus
GPG Key ID: 07DDBEA3CBDC090A
1 changed files with 1 additions and 0 deletions

View File

@ -30,6 +30,7 @@ pub const DiscoveryService = struct {
// 2. Allow port reuse (standard for mDNS)
try posix.setsockopt(fd, posix.SOL.SOCKET, posix.SO.REUSEADDR, &std.mem.toBytes(@as(i32, 1)));
try posix.setsockopt(fd, posix.SOL.SOCKET, posix.SO.REUSEPORT, &std.mem.toBytes(@as(i32, 1)));
// 3. Bind to all interfaces on mDNS port
const bind_addr = try net.Address.parseIp("0.0.0.0", MULTICAST_PORT);