On 02/11/2010, at 8:19 PM, [email protected] wrote: > john skaller wrote: >> Hi, I am wondering if any devs here would be willing >> to help me figure out how to properly close an O_NONBLOCK socket. > > shutdown(socket, SHUT_RD); > Once the socket is readable again, the outbuf should be flushed and you can > close it.
I'm not quite sure I follow. If I shutdown for read, how can the socket ever be readable again? How do I detect this (without blocking)? What has this got to do with the output being flushed? Aren't the input and output buffers independent? Sorry, excuse my ignorance, I've actually heard something like this before, it just doesn't seem to make sense and I don't recall where this would be supported in the Posix standard.. ;( The technique has to work on all platforms if possible (including Linux, BSD, OSX, Windows and Solaris), although the details can differ provided it can be wrapped. [Again, sorry for asking here, just seemed like libcurl devs would be some of the best people to ask.] -- john skaller [email protected] ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
