Closed bnoordhuis closed 10 years ago
var N = process.argv[2] | 0 || 1024; // size in kb var U = require('uhura'); var server = U.createServer(onConnection); server.listen(4567, createConnection); function onConnection(socket, reconnect) { socket.socket.on('data', function(data) { console.log(data.length); }); socket.on('test', function(data) { server.close(); socket.disconnect(); }); } function createConnection() { var socket = U.createClient(); socket.connect(4567); socket.once('connect', function() { socket.send('test', Array(N << 10).join('.')); socket.disconnect(); }); }
Example output on OS X:
$ node t.js 183 63 65536 65536 56386 # exits by itself $ node t.js 184 63 65536 65536 56876 # hangs
On two of my Linux machines, the magic cutoff point appears to be 641 kB. Needs further investigation.
Example output on OS X:
On two of my Linux machines, the magic cutoff point appears to be 641 kB. Needs further investigation.