Skip to content

Commit

Permalink
Different handling of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
James-TR committed Jun 26, 2014
1 parent ca6cfb1 commit c44a9fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stream-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ socketServer.on('connection', function(socket) {

socketServer.broadcast = function(data, opts) {
for( var i in this.clients ) {
if (this.clients[i].readyState == 1)
if (this.clients[i].readyState == 1) {
this.clients[i].send(data, opts);
else
this.emit("error", "not connected");
}
else {
console.log( 'Error: Client ('+i+') not connected.' );
}
}
};

Expand Down

0 comments on commit c44a9fb

Please sign in to comment.