#36858·deno

Unstable UDP listener does not provide `reusePort`/`SO_REUSEPORT` option, all traffic on one thread

Author: ZombieB1309Created Sep 16, 2026Updated Sep 17, 2026

As described. The Deno.listenDatagram API does not provide the SO_REUSEPORT socket option.

Looking through some other issues and code comments shows that it isn't available due to cross-platform compatibility. I think it would be convenient to have this available, at least on Linux. I'm not so sure about how Deno handles I/OCP on Windows, though it would also be a nice-to-have. Deno.TcpListenOptions already implements reusePort.

const workerId = crypto.randomUUID();

const listener = Deno.listenDatagram({
    transport: "udp",
    port: 3000,
    hostname: "127.0.0.1",
    reusePort: true
}); // across several worker threads

const cb = (d: Uint8Array<ArrayBufferLike>, a: Deno.Addr) => {
    console.log(`(${workerId}) ${d.byteLength} from ${a.hostname}:${a.port}`);
}
const loop = () => {
    listener.receive().then(([d, a]) => cb(d, a)).finally(loop);
};
loop();