On 14 February 2011 18:36, Claudio Jeker <cje...@diehard.n-r-g.com> wrote: > > poll() or the other mechanisms to check if a socket is writable or not > have no way to see if a ENOBUF error will be returned on the write. > The problem is that the UDP sendbuffer is always empty (it is only used to > copy in the packet from userland). Then the packet is sent down the > network stack where it can not be queued on the interface because its > output queue is full. In that case ENOBUF is returned to userland but the > socket is still perfectly writable and a sendto() with a different > destination address may actually work. > > If you want to get the maximum speed out of tcpbench in udp mode then you > need to busywait around the write call.
I don't think we need that much speed, I'll just go back to event_dispatch() when ENOBUFS is reached. I'll give more love to this diff send again, don't like all those globals floating around.