On Dec 4, 2007 4:33 PM, Stephen Leake <[EMAIL PROTECTED]> wrote: > >> Note that dumb_socketpair is _not_ actually cross-platform; it has the > >> same #ifdef WIN32 style that netxx_pipe.cc currently has, and the WIN32 > >> version has an extra parameter that is important. Apparently 'socketpair' > >> is implemented on some/most "unix" platforms, but not on Win32? > > > > Right, that code is an implementation of socketpair() for Windows because it > > is not provided by the Windows socket API. Cross platform refers to the > > rest of the code--all platforms can use socketpair() and almost all of the > > rest of the code can be shared between platforms (except for process > > creation, but we probably already have sufficient wrappers for these in the > > $platform/ directories already). > > Currently, all code outside netxx_pipe.cc uses netxx_pipe.cc. So I > don't see what we are gaining by replacing Unix pipes by TCP sockets.
Unless I am very confused, the idea is to be able to use the current Unix-specific code (replacing two calls to pipe() with one call to socketpair()) on both Unix and Windows; and the benefit of this is that the low-level Windows API for asynchronous I/O has fundamentally different semantics from the low-level Unix API, and the rest of netxx expects the Unix semantics, which is why we are getting hangs. ... wait, are we actually going to be able to do async I/O with ncm's fake socketpair()? I do not fully understand the significance of the "make_overlapped" flag, but I see comments in netxx_pipe.cc averring that async I/O only works on Windows in overlapped mode, and comments in socketpair.c saying the socket is not suitable for use as a child process stdio handle if overlapped mode is on. zw _______________________________________________ Monotone-devel mailing list Monotone-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/monotone-devel