nodejitsu/nssocket — Issue #3: socket.send() outside createServer
Author: danielburhans
Created: 2011-11-11 00:14:17+00:00
State: open

I am semi-new to Node.JS and IO based writing.
Is there a way I access the socket var that is passed into the anonymous function of createServer I when creating the nssocket outside of the anonymous function?

```javascript
var server = nssocket.createServer(function (socket) {
socket.send('ello',{ testing:'test'});
socket.data('iam', function (data) {
console.dir(data);
})
}).listen(6785);
```

example:

```javascript
server.sockets[SOCKET_ID].send('event',{"msg":data});
```
Or a way to broadcast if there are multiple connections.

thanks