- //code - node.js w/socket.io
- clients = io.of('/client').on('connection', function(socket) {
- var id = "";
- socket.on('info', function(data) {
- id = data.id;
- console.log("Inside the function: #"+id);
- });
- console.log("Outside the function: #"+id);
- //result
- >>Outside the function: #
- >>Inside the function: #5555