LearnBoost/socket.io — Issue #666: Send packet to client in a particular room
Author: balbuzar
Created: 2011-11-25 19:05:08+00:00
State: open

I want to send a message to one client socket via a custom room.
In examples, there is:

```javascript
var news = io
.of('/news')
.on('connection', function (socket) {
socket.emit('item', { news: 'item' });
});
```
But there is no example to show how to emit after connection

Is there a simple way rather than this code :

```javascript
_.each(io.of('/news').clients(), function(client) {
if (client.id == clientSocket.id) {
client.emit('item', { news: 'item' });
}
});
```

Thanks