From: James Y. <ji...@yo...> - 2005-02-24 10:03:26
|
On Thu, 24 Feb 2005, Jamie Lokier wrote: > James Yonan wrote: > > Listening on multiple sockets is also bad from a performance perspective > > unless you are using a modern polling API such as epoll on Linux > > 2.6. > > That's only an issue if you have lots of interfaces. > If you only have a few, poll() will be fine. > > But, if you're going to have a little non-portability, it's much > easier to use the IP_PKTINFO method of getting the incoming > destination address and interface (IP_PKTINFO with recvmsg/sendmsg). > > That has the advantage that you don't need to enumerate the > interfaces, and you don't need to track interface changes: you can > just use the received pktinfo struct for sending out the same > interface, without interpreting it. The NTP guys (another UDP server) had a bit of a low-grade burn over this: http://bugzilla.ntp.org/show_bug.cgi?id=314 It seems the anti-IP_PKTINFO camp won out? James |