As I'm new to nodejs, and coming from PHP background, I might sound naive in this question, but
I was digging through the code of Ghost to get an idea of the design, where I stumbled upon an implementation which persists connections when connection happens.
GhostServer.prototype.connection = function (socket) {
var self = this;
self.connectionId += 1;
socket._ghostId = self.connectionId;
socket.on('close', function () {
delete self.connections[this._ghostId];
});
self.connections[socket._ghostId] = socket;
};
Listened here
self.httpServer.on('connection', self.connection.bind(self));
My questions are
Could anyone please clear my confusions?