沈斌
2018-05-03 8fbd26ea16e81c29926188ec5a8e149c032d102f
代码优化 - 去掉无效的queue
1 files added
2 files modified
16 ■■■■■ changed files
.idea/misc.xml 6 ●●●●● patch | view | raw | blame | history
client.js 2 ●●● patch | view | raw | blame | history
server.js 8 ●●●● patch | view | raw | blame | history
.idea/misc.xml
New file
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="JavaScriptSettings">
    <option name="languageLevel" value="ES6" />
  </component>
</project>
client.js
@@ -3,7 +3,7 @@
 */
var net = require('net');
var HOST = '121.40.92.176';
var HOST = 'dev1.7drlb.com';
var PORT = 6789;
var client = new net.Socket();
server.js
@@ -7,7 +7,7 @@
var mongoClient = require('mongodb').MongoClient;
var config = require('./config');
var method = require('./method');
var queue = require('./queue');
//var queue = require('./queue');
var map = {
    "5a0000010001": 32,  //心跳命令行
@@ -105,7 +105,7 @@
        var value = data.slice(0, length);
        //console.log(moment().format('YYYY-MM-DD HH:mm:ss') + " => " + value);
        queue.publishMessage(value);
        //queue.publishMessage(value);
        handleData(db, socket, value);
@@ -135,8 +135,8 @@
    //初始化三级警报通讯方式
    method.initConfigs(db);
    //监听三级警报通讯方式的变化
    queue.listenToMQ("ex_data_config");
    // //监听三级警报通讯方式的变化
    // queue.listenToMQ("ex_data_config");
    net.createServer().on('connection', function(socket){
        console.log('CONNECTED: ' + socket.remoteAddress +':'+ socket.remotePort);