MS Windows (stupidly) lacks a socketpair() function. All the re-implementations I found on the net faked it with pipes, which are (also stupidly) not selectable. It's trivial to code a selectable win32 socketpair, making it doubly stupid that it's not there in the first place, and triply stupid that all the other implementations posted are useless.
p.s. it's impossible to write "doubly", any more, without thinking about Spinal Tap and smiling.
[Update: the erstwhile predominance of useless win32 socketpair implementations might be seen as a manifestation of Bram's Law. I don't know what it means for Bram's Law that a useful one has now been posted. Bram, are you there?]