Add comms.stop to tidy up keepalive timer

This commit is contained in:
Nick O'Leary
2014-08-01 21:55:05 +01:00
parent 6c464ed3a4
commit 8e8e13a3a2
4 changed files with 112 additions and 90 deletions

View File

@@ -82,6 +82,11 @@ function start() {
}, webSocketKeepAliveTime);
}
function stop() {
clearInterval(heartbeatTimer);
wsServer.close();
}
function publish(topic,data,retain) {
if (retain) {
retained[topic] = data;
@@ -116,5 +121,6 @@ function handleRemoteSubscription(ws,topic) {
module.exports = {
init:init,
start:start,
stop:stop,
publish:publish,
}