{"action":"opened","issue":{"url":"https://api.github.com/repos/Automattic/socket.io/issues/2168","labels_url":"https://api.github.com/repos/Automattic/socket.io/issues/2168/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/socket.io/issues/2168/comments","events_url":"https://api.github.com/repos/Automattic/socket.io/issues/2168/events","html_url":"https://github.com/Automattic/socket.io/issues/2168","id":93029034,"number":2168,"title":"socket.emit event for only the current user doesn't fire","user":{"login":"flashios09","id":1313482,"avatar_url":"https://avatars.githubusercontent.com/u/1313482?v=3","gravatar_id":"","url":"https://api.github.com/users/flashios09","html_url":"https://github.com/flashios09","followers_url":"https://api.github.com/users/flashios09/followers","following_url":"https://api.github.com/users/flashios09/following{/other_user}","gists_url":"https://api.github.com/users/flashios09/gists{/gist_id}","starred_url":"https://api.github.com/users/flashios09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flashios09/subscriptions","organizations_url":"https://api.github.com/users/flashios09/orgs","repos_url":"https://api.github.com/users/flashios09/repos","events_url":"https://api.github.com/users/flashios09/events{/privacy}","received_events_url":"https://api.github.com/users/flashios09/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-04T16:42:34Z","updated_at":"2015-07-04T16:42:34Z","closed_at":null,"body":"I'm using socket.io and when i want to emit an event from the server to client **only for the connected user** it doesn't work !\r\nI don't have an error or any response :(\r\nThats my code\r\n```js\r\n// Server.js\r\nvar server     = require('http').createServer(),\r\n    io         = require('socket.io')(server),\r\n    logger     = require('winston'),\r\n    port       = 1337;\r\n\r\n// Logger config\r\nlogger.remove(logger.transports.Console);\r\nlogger.add(logger.transports.Console, { colorize: true, timestamp: true });\r\nlogger.info('SocketIO > listening on port ' + port);\r\n\r\nio.on('connection', function (socket){\r\n    logger.info('SocketIO > Connected socket ' + socket.id);\r\n\r\n    socket.on('ElephantIO.login', function (user){\r\n        socket.emit('SocketIO.login', user);\r\n    });\r\n\r\n    socket.on('disconnect', function () {\r\n        logger.info('SocketIO > Disconnected socket ' + socket.id);\r\n    });\r\n});\r\n\r\nserver.listen(port);\r\n```\r\n```js\r\n// Client.js\r\n(function() {\r\n    var socket = io.connect('http://localhost:1337');\r\n\r\n    socket.on('SocketIO.login', function(user) {\r\n        console.log(user);\r\n        alert('SocketIO.login');\r\n    });\r\n\r\n})();\r\n```\r\nIf i change the ```socket.emit('SocketIO.login', user);``` with ```socket.broadcast.emit('SocketIO.login', user);``` to emit this event to the **all other connected user** it works\r\n\r\nIf i change the ```socket.emit('SocketIO.login', user);``` with ```io.emit('SocketIO.login', user);``` to emit this event to the **all connected user** i have the same behavior of the ```socket.broadcast.emit('SocketIO.login', user);```\r\n\r\nAlways the **current user window** don't have a response or an error !"}}