Laurent Bercot:

how does the daemon know what fd corresponds to what use?

In the wild, it's generally a for() loop over the passed-in descriptors that checks each socket type. In the wild, only one of any type is often the case.

"If AF_INET4 and SOCK_DGRAM, this must be my UDP4 socket."

That's how I patched dnscache and tinydns to work, too. A simple set of socket_is() functions in the Bernstein socket library, and it is off and away.

Reply via email to