code: function TCPSocket(port) {
  
      var self = this;
  
      this.server = net.createServer(function(socket) {
  
          socket.setEncoding('utf8');
  
          self.on('message', function(message) {
  
              logger.log('debug', 'TCP socket:', message);
              //var jsonMessage = message.getJSON();
          });
  
          socket.on('data', function(jsonMessage) {
  
              // There may be multiple messages in each chunk of TCP data.
              var messageArray = JSON.parse('[' + jsonMessage.replace('}\r\n{', '},{') + ']');
  
              _.each(messageArray, function(message) {
                  console.log('Received message', message);
                  var message = new Message(message);
                  self.emit('message', message);
              });
          }); 
  
          // Add a 'close' event handler for the TCPClient socket
          socket.on('close', function() {
  
              socket.removeListener('data');
              self.removeListener('message');
              logger.info('TCP socket disconnected');
          }); 
  
          self.socket = socket;
  
          logger.info('TCP socket connected');
  
      }).listen(port);
  }
docs: /* TCP socket manager