@@ -42,11 +42,10 @@ function broadcast(evt, data) {
constsdata=JSON.stringify({event:evt,data:data});
for (varcinclients){
clients[c].once('write',(function (sdata){
/* It's possible that onClientData has nuked this socket already.
* Check that 'this' still has 'sendline' to avoid an exception.
*/
if (this.sendline!==undefined)this.sendline(sdata);
}).bind(clients[c],sdata));// Using bind "temporarily" pending better closure+callback stuff
if (this.sendline!==undefined){// client went away between queueing and running this callback? Alls I knows is that this.sendline may be undefined here.
this.sendline(sdata);
}
}).bind(clients[c],sdata));// bind because otherwise 'sdata is undefined'