Subject: Re: no buffer space available
To: None <netbsd-users@netbsd.org>
From: Marc <sudog@sudog.com>
List: netbsd-users
Date: 06/25/2001 18:10:20
As something somewhat related to the ENOBUFS problems, I have a
UDP-based application I'm writing and I'd like to find a way to
select() on the UDP socket until it's truly ready for writing.
Let me back up a bit.
mytime is filled with a few fractions of a second,
writemask is FD_SET to include mysock.
select(mysock+1, NULL, &writemask, NULL, &mytime);
Select always returns immediately with "mysock" set in "writemask",
even if sendto() on mysock would return ENOBUFS--seemingly
incongruous.
It's true, that perhaps the level of abstraction between the socket
"mysock' and the underlying drivers is too great for select() to peek
through--but surely there's some way to do this?
How am I "supposed" to handle this situation? Currently I'm just
cycling back to the select() call again to try it over in the case of
ENOBUFS and it seems to work, but this feels like busy polling to
me -- why bother with the select() in that case? :)
Or are applications not supposed to push the network layers like this?
Maybe an fcntl or ioctl..? =]
Thanks,
Marc