Skip to content
Snippets Groups Projects
Commit 54f9c770 authored by rswindell's avatar rswindell
Browse files

Stop throwing exceptions when the socket is disconnected on receive as this was

spamming the data/error.log file with ever server start/stop/recycle:
Wed May 13 2015 12:45 am vert.synchro.net
1072 JSON socket disconnected

Wed May 13 2015 12:49 am vert.synchro.net
0492 JSON socket disconnected

Wed May 13 2015 12:51 am vert.synchro.net
1108 JSON socket disconnected
parent 2c4b12c4
No related branches found
No related tags found
No related merge requests found
...@@ -349,14 +349,14 @@ function JSONClient(serverAddr,serverPort) { ...@@ -349,14 +349,14 @@ function JSONClient(serverAddr,serverPort) {
/* package a query and send through the socket */ /* package a query and send through the socket */
this.send=function(packet) { this.send=function(packet) {
if(!this.socket.is_connected) if(!this.socket.is_connected)
throw("socket disconnected"); throw("socket disconnected 1");
this.socket.sendJSON(packet); this.socket.sendJSON(packet);
} }
/* receive a data packet */ /* receive a data packet */
this.receive=function() { this.receive=function() {
if(!this.socket.is_connected) if(!this.socket.is_connected)
throw("socket disconnected"); return false; // Was throw("socket disconnected"); but this was filling up the error.log with every server recycle
if(!this.socket.data_waiting) if(!this.socket.data_waiting)
return false; return false;
var packet=this.socket.recvJSON(); var packet=this.socket.recvJSON();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment