Verified Commit 1c34685e authored by Camil Staps's avatar Camil Staps 🚀

Don't warn for exited server until a connection has been set up (shown in the...

Don't warn for exited server until a connection has been set up (shown in the beginning while we're waiting for the iTasks server)
parent 3d4029ee
...@@ -10,6 +10,8 @@ const {app,ipcMain,ipcRenderer}=require ('electron'); ...@@ -10,6 +10,8 @@ const {app,ipcMain,ipcRenderer}=require ('electron');
const ABC_INTERPRETER=require ('.'+path.sep+'abc-interpreter.js'); const ABC_INTERPRETER=require ('.'+path.sep+'abc-interpreter.js');
const {ABCInterpreter,SharedCleanValue,CleanHeapValue}=ABC_INTERPRETER; const {ABCInterpreter,SharedCleanValue,CleanHeapValue}=ABC_INTERPRETER;
var log_server_close=false;
class Component { class Component {
static instantiate (opts) { static instantiate (opts) {
return ABCInterpreter.instantiate ({ return ABCInterpreter.instantiate ({
...@@ -56,9 +58,13 @@ class Component { ...@@ -56,9 +58,13 @@ class Component {
this.request_id=0; this.request_id=0;
this.buffer=''; this.buffer='';
this.socket.on ('connect',() => {
log_server_close=true;
});
this.socket.on ('data',this.onData.bind (this)); this.socket.on ('data',this.onData.bind (this));
this.socket.on ('close',() => { this.socket.on ('close',() => {
console.log ('server exited'); if (log_server_close)
console.log ('server exited');
}); });
this.socket.on ('error',err => { this.socket.on ('error',err => {
if (err.errno=='ECONNREFUSED') if (err.errno=='ECONNREFUSED')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment