Below is the app.js part, it has a socket connection with the client
io.sockets.on('connection', function (soc) { soc.emit('news', { status: 'connected' }); });
What I want to do is to access the social var outside of closing the connection, for example
io.sockets.on('connection', function (soc) { do something magical here so I can access soc from outside }); soc.emit('news', { status: 'connected' });
What additional equipment should be added to the archive of this structure?
source share