i made a program that connects my java programm who sends data to my nodejs server using sockets and the nodejs server is supposed to send the received data to the browser using socket.io but there is a problem i do receive the data from java but the node server doesnt send it to the browser here is the code
// Create an instance of the Server and waits for a connexion net.createServer(function(sock) { // Receives a connection - a socket object is associated to the connection automatically console.log('CONNECTED: ' + sock.remoteAddress + ':' + sock.remotePort); // Add a 'data' - "event handler" in this socket instance sock.on('data', function(data) { //data was received in the socket and converting it into string var textChunk = data.toString('utf8'); io.emit('message', textChunk); //socket.io is supposed to send the data to the browser console.log(textChunk); }); // Add a 'close' - "event handler" in this socket instance sock.on('close', function(data) { // closed connection console.log('CLOSED: ' + sock.remoteAddress + ' ' + sock.remotePort); }); }).listen(PORT, HOST);