Created
November 18, 2010 17:04
-
-
Save Kami/705283 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 http = require('http'); | |
| var assert = require('assert'); | |
| var http_server = http.createServer(function(request, response) { | |
| response.writeHead(200, {'Content-Type': 'text-plain'}); | |
| response.end(''); | |
| }).listen(8081, '127.0.0.1', done); | |
| function done() { | |
| var client = http.createClient(8081, 'localhost', true); | |
| var request = client.request('GET', '/', {}); | |
| request.end(); | |
| client.on('end', function() { | |
| // This will fail and if the request.connection.destroy() isn't called manualy, | |
| // the socket will hang in the CLOSE_WAIT state | |
| assert.ok(request.socket._writeQueue.length == 0); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment