0

I have setup two PC in the local network. One is Linux PC where i am running a Script, sending Heart beat message every 1s over UDP as IPv6 multicast message (FF02::1). In the other windows PC, I am running the below node.js code to receive the Heart beat message. I can see the messages in the Wireshark log, but i cant read the message from my code.

var HOST = '::';
var port = 50010;
var dgram = require('dgram');
var message = new Buffer('(data)');
var client = dgram.createSocket('udp6');
// client.bind(port,HOST);

// client.setMulticastLoopback(true);nod3


client.on("error",function(err){
    console.log("server error:\n"+err.stack);
})

client.on("message",function(msg,rinfo){
    console.log("Received Message:",msg+"from"+rinfo.address+":"+rinfo.port);
    console.log("Node address:"+ rinfo.address);
    console.log("Node port:"+rinfo.port);
})


client.bind('50010', '::', () => {
    client.addMembership('ff02::1', '::%17');
  });

client.on("listening",function(){
var address = client.address();
console.log("server listioning"+":"+address.address+":"+address.port)

});
2
  • Is it not a firewall issue? Commented Jun 17, 2020 at 16:04
  • No, i have enabled the port in the firewall. That's why i could see the messages in the wireshark log Commented Jun 17, 2020 at 16:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.