This file contains 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 i = 0; | |
// complain loudly if node exits before this handler is removed | |
var onExit = function() { | |
console.log('Exiting prematurely! (after %s iterations)', i); | |
}; | |
process.on('exit', onExit); | |
function doIteration() { |
This file contains 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
/* | |
Demonstration of apparent bug in tls.js. When piping a readable file stream into a writable | |
TLS stream (an https ClientRequest) the TLS stream write() method returns false, causing | |
the readable stream to pause, then never emits a drain event. The readable stream thus | |
remains paused and the transfer hangs. | |
*/ | |
var https = require('https'); | |
var http = require('http'); | |
var fs = require('fs'); |