
9 Aug
2010
9 Aug
'10
1:31 p.m.
You need to close the parent's socket in the child fork, as well as the parent - if it's inherited by the child, it's held open there, even if the parent closes it.
Thanks! That did the trick. I did so by adding
close_fds = True
to the CreateProcess record. However the documentation of System.Process says that this only works on Windows if std_in, std_out, and std_err are all set to Inherit. This is not the case in my program so it will not work on any nodes that run on Windows. What is the workaround for doing this kind of thing in Windows? Also since the file descriptor of the socket appears to be inherited by the child process, can I just start using it rather than closing it in both the parent and child and then creating a new one?