I'm getting error "No buffer space available" when I try to write to UDP socket with "write()" function. This only happens when I have heavy load and need to write data to socket very quick. Is there any way to get more information about this error? Why it happen and how to avoid it?
So it's not bug but some kind of feature?
Well, it’s a feature in that:
it’s documented behaviour (see the list of return values in the man page for
)writean error is better than running the kernel completely out of memory
However, I’ll agree that, as an API, it is less than ideal. This is a common theme when programming with BSD Sockets, at least in my experience.
… or we should create new socket?
The socket is fine; you don’t have to recreate it.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"