0

Data-Stream Access with net.Socket class of Node.JS/Javascript

May I ask for some help?

I am attempting to monitor data from a tuner serially connected to a Global Cache iTach ("IP2SL"), using NodeJS with javascript. 

Although the snippet below permits access to the data-stream; when it is run, the code blocks visibility of this data to other computers on the network. As you can see, the application uses the net.Socket class of NodeJS. Would anyone know if there is a way to adapt the code so that it would permit access to the data but not block the data-stream visibility to other computers on my network?

Thank you in advance. Bill Hunter

const hostname = '192.168.1.237';

monitorData();

function monitorData() {

   const network = require('net');

   const tuneSuite = new network.Socket();

   tuneSuite.on('data', function(tuneSuiteFeedback){console.log('Feedback:"' + tuneSuiteFeedback + '");'); });

   tuneSuite.on('close', function() { console.log('disconnected'); });

   tuneSuite.connect(4999, hostname, function() { console.log('connected'); });

}

0 comments

Please sign in to leave a comment.