Created
February 24, 2011 17:58
-
-
Save jorangreef/842563 to your computer and use it in GitHub Desktop.
Server.request.pause() causing problems for subsequent requests on keep-alive connections
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'); | |
http.createServer( | |
function(request, response) { | |
request.pause(); | |
response.writeHead(200, { 'Content-Type': 'text/plain' }); | |
response.write('now press CMD + R and every other request will hang for 2 minutes before returning'); | |
response.end(); | |
} | |
).listen(4000); | |
http.createServer( | |
function(request, response) { | |
response.writeHead(200, { 'Content-Type': 'text/plain' }); | |
response.write('now press CMD + R and the next request will return fine'); | |
response.end(); | |
} | |
).listen(2000); | |
// Visit http://localhost:2000 and everything works fine. | |
// Visit http://localhost:4000 and every other request will hang for 2 minutes before returning. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment