Not logged inOpenClonk Forum
Up Topic HTTP Content-Length

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Günther
Er, yes. But poll is level-triggered, so having to read everything would be a windows-only thing. epoll, the Linux equivalent to Windows' "events", has both edge- and level-triggered notifications, so perhaps windows also has both?

Looking at the code, New() looks fine, apart from the malloc thing, though a nullpointer for a zero-length allocation should be fine for the buffer, as you couldn't dereference the pointer anyway. (Posix helpfully declares: "If the size of the space requested is 0, the behavior is implementation-defined: the value returned shall be either a null pointer or a unique pointer.", and C89 concurs.) But there's a suspiciously commented-out assertion that would fail on zero-length buffers in getMBufPtr. Sadly, the commit message of the commit that commented out the assertion is simply "fixes and enhancements". In any case, passing a nullpointer to read or recv is bad style.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill