I have a socket.io server using redis called "server.js" that starts the node server. This is currently something like this:
var client = redis.createClient() var io = require('socket.io').listen(80); io.sockets.on('connection', function (socket) { client.set();
Then I start my server and it just stays alive. It is not right? Should it be like that?
var io = require('socket.io').listen(80); io.sockets.on('connection', function (socket) { var client = redis.createClient() client.set();
Should I continue to open and close redis, or can I just open it once and leave it open? Which of the above snippets is the right way to start the server?
kidcapital
source share