Created
November 1, 2011 10:11
-
-
Save josephg/1330256 to your computer and use it in GitHub Desktop.
http client behaviour under 0.5.0
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
$ coffee cc.coffee | |
Error: socket hang up | |
at createHangUpError (http.js:1083:15) | |
at Socket.<anonymous> (http.js:1166:27) | |
at Socket.emit (events.js:88:20) | |
at Array.0 (net.js:280:10) | |
at EventEmitter._tickCallback (node.js:194:26) |
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
http = require 'http' | |
http.createServer (req, res) -> | |
res.writeHead 200, {'Content-Type': 'text/plain'} | |
# not calling res.end() | |
.listen 3000, -> | |
req = http.get {host:'127.0.0.1', path:'/', port:3000}, (res) -> | |
# This is never called - I wonder if the head is buffered waiting for data? | |
console.log res.statusCode | |
setTimeout (-> req.abort()), 1000 | |
# This error handler gets called. | |
req.on 'error', (e) -> console.warn e.stack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am getting the same error, did you figure out why it was happening?