Hi all,
I'm experimenting with porting a C++ library into the Emscripten environment. One thing this library does is inter-thread communication via socket-pairs (as created by socketpair(), or as a fallback, by connecting two TCP sockets together). For example, a parent thread might hold one socket of the socket-pair, while the child-thread watches the other socket (while blocking inside select()). Then, when the parent wants the child thread to wake up and exit, all it has to do is close its socket, and the child thread will immediately return from select(), see that the connection is closed, and exit.
That works fine while running natively, but doesn't seem to work under Emscripten. In particular, the call to setsocketpair() causes an assertion failure ("call not supported"), and the TCP-based fallback mechanism doesn't work either (presumably because the JavaScript environment doesn't allow a script to create TCP-accepting sockets?).
My question is, is socketpair() a call that can be supported under Emscripten? Or am I crazy for expecting this sort of thing to work under Emscripten in the first place?
Thanks,
Jeremy