Funktion zum senden von UDP-Nachrichten hinzugefügt

This commit is contained in:
Robert Richter 2019-05-13 21:47:46 +02:00
parent b4355df111
commit c6d2fc0193

View File

@ -30,4 +30,16 @@ module.exports = function(app_cfg, waip_io, sql){
sql.db_log('Fehler-WAIP', 'Fehler: Einsatz von ' + remote.address + ':' + remote.port + ' Fehlerhaft: ' + message);
}
});
function send_message(message) {
udp_server.send(message, 0, message.length, app_cfg.global.udpport, 'localhost', function(err, bytes) {
if (err) throw err;
sql.db_log('UDP-Testalarm an localhost Port ' + app_cfg.global.udpport + ' gesendet.');
//client.close();
});
};
return {
send_message: send_message
};
};