dimanche 19 avril 2015

Ping to udp port of Team Speak 3 server with node.js

i have a Team Speak 3 server running in one machine. I need test if the Team Speak 3 is running, with node.js i implement a UDP client.



var dgram = require('dgram');
var message = new Buffer("ping ts server");
var client = dgram.createSocket("udp4");

client.send(message, 0, message.length, 55223, "127.0.0.1",
function (err, bytes) {
if (err) {
console.log('Not running !!');
throw err;
}

console.log("Wrote " + bytes + " bytes to socket.");
});


But when i run this code, the udp client in node ever say to me that the server is running, including when i stop the server.


Please anyone can help me?


Aucun commentaire:

Enregistrer un commentaire