
Hi Olaf, --- Olaf van der Spek <olafvdspek@gmail.com> wrote:
True, but sync operations are already quite easy to do easily and 'portably' via BSD sockets.
Hmmm, for very simple use cases maybe. But consider... - Does the socket API need to be initialised (WSAStartup etc)? - What is the best way to handle SIGPIPE if you write to a disconnected socket? - Thread-safety (or otherwise) of host resolution functions like getaddrinfo. - Whether IPv6 capable functions are available (they're not on Windows 2000). - Functions for scatter-gather operations (recvmsg/sendmsg and WSASend/WSARecv) have quite different signatures. - Whether socket option values are passed as void* or char*. etc, etc. In my experience, if you want your code to be portable it will quickly acquire #ifdefs to cope with these differences. And that's assuming you discover the differences at all - what's the bet that there are people who port socket code to Mac OS X who aren't aware that getaddrinfo isn't thread safe. Cheers, Chris