Procházet zdrojové kódy

Different handling of errors

James před 11 roky
rodič
revize
c44a9fb7fe
1 změnil soubory, kde provedl 5 přidání a 3 odebrání
  1. 5 3
      stream-server.js

+ 5 - 3
stream-server.js Zobrazit soubor

@@ -35,10 +35,12 @@ socketServer.on('connection', function(socket) {
35 35
 
36 36
 socketServer.broadcast = function(data, opts) {
37 37
 	for( var i in this.clients ) {
38
-		if (this.clients[i].readyState == 1)
38
+		if (this.clients[i].readyState == 1) {
39 39
 			this.clients[i].send(data, opts);
40
-		else
41
-			this.emit("error", "not connected");
40
+		}
41
+		else {
42
+			console.log( 'Error: Client ('+i+') not connected.' );
43
+		}
42 44
 	}
43 45
 };
44 46