Last active
August 29, 2015 14:01
-
-
Save xdenser/73f33f6728e6de6fd10d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dgram = require('dgram'), | |
vsocket = dgram.createSocket('udp4'), | |
dataRcv=0, prevDataRcv=0; | |
setInterval(function(){ | |
console.log('Rcv rate',dataRcv-prevDataRcv); | |
prevDataRcv = dataRcv; | |
},1000) | |
vsocket.bind(35668,'127.0.0.1',function(){ | |
vsocket.addMembership('224.0.0.101','127.0.0.1'); | |
vsocket.on('message',function(data){ | |
dataRcv+=data.length; | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dgram = require('dgram'), | |
socket = dgram.createSocket('udp4'), | |
dataSent=0, prevdataSent= 0, | |
buf = new Buffer(65507); | |
setInterval(function(){ | |
console.log('Send rate',dataSent-prevdataSent); | |
prevdataSent = dataSent; | |
},1000) | |
socket.bind('127.0.0.1',function(){ | |
socket.addMembership('224.0.0.101','127.0.0.1'); | |
socket.setMulticastLoopback(false); | |
function send(){ | |
dataSent+=buf.length; | |
socket.send(buf,0,buf.length,35668,'224.0.0.101',send); | |
} | |
send(); | |
}); |
Hey
I can't reproduce this
Suggest you look at https://github.com/hij1nx/net-log
for an initial direction on how you might want to go about this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test of max UDP multicats rate on loopback interface.