1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Turn down console.log-ing in udp node

This commit is contained in:
Dave C-J 2014-02-12 22:10:22 +00:00
parent 309e5f4921
commit 46765d5737

View File

@ -49,7 +49,7 @@ function UDPin(n) {
var address = server.address(); var address = server.address();
node.log('udp listener at ' + address.address + ":" + address.port); node.log('udp listener at ' + address.address + ":" + address.port);
if (node.multicast == "true") { if (node.multicast == "true") {
server.setBroadcast(true) server.setBroadcast(true);
server.setMulticastTTL(128); server.setMulticastTTL(128);
server.addMembership(node.group,node.iface); server.addMembership(node.group,node.iface);
node.log("udp multicast group "+node.group); node.log("udp multicast group "+node.group);
@ -105,7 +105,7 @@ function UDPout(n) {
if (node.base64) { message = new Buffer(b64string, 'base64'); } if (node.base64) { message = new Buffer(b64string, 'base64'); }
else if (msg.payload instanceof Buffer) { message = msg.payload; } else if (msg.payload instanceof Buffer) { message = msg.payload; }
else { message = new Buffer(""+msg.payload); } else { message = new Buffer(""+msg.payload); }
console.log("UDP send :",add,por,msg.payload.toString()); //console.log("UDP send :",add,por,msg.payload.toString());
sock.send(message, 0, message.length, por, add, function(err, bytes) { sock.send(message, 0, message.length, por, add, function(err, bytes) {
if (err) node.error("udp : "+err); if (err) node.error("udp : "+err);
}); });