Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Commented Feature: Debugging does not work with child processes [1220]

$
0
0
When I spawn a "child_process" or use the Node sample for clustering, I'm not able do debug those child_processes. The child_processes are not capable to communicate with each other also and console.log doesn't work either for the child's. But when I start this sample with a command line everything works fine.

Sample (http://nodejs.org/api/cluster.html):
```
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;

if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}

cluster.on('exit', function(worker, code, signal) {
console.log('worker ' + worker.process.pid + ' died');
});
} else {
// Workers can share any TCP connection
// In this case its a HTTP server
http.createServer(function(req, res) {
res.writeHead(200);
res.end("hello world\n");
}).listen(8000);
}
```
Comments: This is a limitation for me as well. Even if its not possible to have the child be debugged (eg. on a separate debug port), please enable parent/child communication as it means no child process code can be used when running in VS. Thanks

Viewing all articles
Browse latest Browse all 4630

Trending Articles