Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var event = new net.Socket();
var HOST = settings.cbusip;
var COMPORT = 20023;
var EVENTPORT = 20025;
var KEEPALIVE = 30;

var logging = settings.logging;

Expand All @@ -64,6 +65,11 @@ function started(){
command.write('GET //'+settings.cbusname+'/'+settings.getallnetapp+'/* level\n');
},settings.getallperiod*1000);
}
// Send a NOOP to the Cgate server to keep the connection open and detect if the connection was closed
setInterval(function(){
console.log('NOOP');
command.write('NOOP\n');
},KEEPALIVE);
}

}
Expand Down