The following code works on Linux but not Windows:

server.js

var child = require('child_process').fork('child.js');


// Open up the server and send sockets to child
var server = require('net').createServer();


server.on('connection', function (socket) {
    child.send('socket', socket);
    server.getConnections(function(err, count) {
        console.log("Connections: " + count);
    });
});
server.listen(8081);

child.js

process.on('message', function(message, socket) {
        console.log('Got socket');
        socket.on('data', function(data) {
        console.log(data.toString('utf8'));
    });
});

Is this supposed to work on Windows 7?  The failure is that the data event 
is never fired.

Also, I have had no success in sending a partially read socket to the child 
on Windows or Linux.  What I am trying to do is to accept an http request 
in the server in the normal way and after reading the headers I want to 
sent the request socket to a child process to handle the body of the 
request.
Is it possible that the HTTP server has already read the request body from 
the socket by the time that the server callback is called?

Thanks,
Andy


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/338e7efa-6227-4f63-bb1e-5a5c87776c7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to