The following is going to show some pitfalls and their solution when working with NodeJs, Socket.IO and concurrent processes.
Basic setup Socket connections In order to use socket communication with NodeJS a basic server side code block might look this see online docs:
var io = require('socket.io').listen(80); io.sockets.on('connection', function (socket) { socket.emit('news', { hello: 'world' }); }); This enables you to send some data through the socket connection to the client and with just a little more code it could even retrieve some data from the client.
...
Read more