Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

child_process send socket handle,the child process can't read data from socket handle on win8 x64 #6684

Closed
sundq opened this issue Dec 12, 2013 · 3 comments

Comments

@sundq
Copy link

sundq commented Dec 12, 2013

when parent process send a socket which have connected to child process,The child process can't read data from socket when the first request incoming,but next
request is OK,my plateform is win7 x64.
my code like this:
parent process:

var net = require('net');
var util = require('util');
var childProcess = require('child_process');

var start = function (options, cb) {

    var worker = childProcess.fork("app.js");
    server = net.createServer();
    server.on("connection", function (socket) {
        socket.pause();
        try {
            worker.send("connect", socket);
        } catch (e) {
            console.log(e);
        }
    });

    server.listen(8989);
}

start();

child process:

process.on("message", function (msg, socket) {
    socket.resume();
    socket.on("data",function(data){
       console.log(data);
    });
});
@sundq sundq closed this as completed Dec 12, 2013
@sundq sundq reopened this Jan 2, 2014
@indutny
Copy link
Member

indutny commented Jan 3, 2014

Which node.js version are you using?

@chrisdickinson
Copy link

I can't reproduce this locally. Closing due to lack of activity & reproducibility. If you have more information, please comment and I'll reopen this issue.

@cjihrig
Copy link

cjihrig commented Nov 15, 2014

For what it's worth, this might be a manifestation of the same issue that was closed in #8576. Might be worth checking out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants