|
@@ -376,40 +376,3 @@ exports.init = function(startupTime, config, events) {
|
|
var instance = new StatdMySQLBackend(startupTime, config, events);
|
|
var instance = new StatdMySQLBackend(startupTime, config, events);
|
|
return true;
|
|
return true;
|
|
};
|
|
};
|
|
-
|
|
|
|
-/*
|
|
|
|
- * Backend example : repeater.js
|
|
|
|
- *
|
|
|
|
-
|
|
|
|
-var util = require('util'),
|
|
|
|
- dgram = require('dgram');
|
|
|
|
-
|
|
|
|
-function RepeaterBackend(startupTime, config, emitter){
|
|
|
|
- var self = this;
|
|
|
|
- this.config = config.repeater || [];
|
|
|
|
- this.sock = dgram.createSocket('udp6');
|
|
|
|
-
|
|
|
|
- // attach
|
|
|
|
- emitter.on('packet', function(packet, rinfo) { self.process(packet, rinfo); });
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-RepeaterBackend.prototype.process = function(packet, rinfo) {
|
|
|
|
- var self = this;
|
|
|
|
- hosts = self.config;
|
|
|
|
- for(var i=0; i<hosts.length; i++) {
|
|
|
|
- self.sock.send(packet,0,packet.length,hosts[i].port,hosts[i].host,
|
|
|
|
- function(err,bytes) {
|
|
|
|
- if (err) {
|
|
|
|
- console.log(err);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-exports.init = function(startupTime, config, events) {
|
|
|
|
- var instance = new RepeaterBackend(startupTime, config, events);
|
|
|
|
- return true;
|
|
|
|
-};
|
|
|
|
-*/
|
|
|
|
-
|
|
|
|
-
|
|
|