Merge pull request #298 from hindessm/test-comms

Add comms tests
This commit is contained in:
Nick O'Leary
2014-07-24 15:29:06 +01:00
2 changed files with 115 additions and 5 deletions

View File

@@ -50,7 +50,13 @@ function start() {
}
});
ws.on('message', function(data,flags) {
var msg = JSON.parse(data);
var msg = null;
try {
msg = JSON.parse(data);
} catch(err) {
util.log("[red:comms] received malformed message : "+err.toString());
return;
}
if (msg.subscribe) {
handleRemoteSubscription(ws,msg.subscribe);
}