I don’t know from head to toe, and this probably varies from platform to platform, but here, as you can find out!
Use this code:
var net = require('net');
net.createServer(function (socket) {
socket.on('data', function(data) {
console.log('chunk length: ' + data.length);
});
}).listen(function() {
console.log("Server listening on %j", this.address());
});
And then quote the large file (for example, ISO) through "nc localhost $ port", using the port number that the script will sleep when it starts, and look at the result to see what size is the largest block. On my OS X computer, it looks like the largest buffer - 40,960 bytes, but it may be different on yours.
clee source
share