Created
April 5, 2015 01:44
-
-
Save maritz/9acbc312688bb52bbe4e to your computer and use it in GitHub Desktop.
http server not closing
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
Server listening on 3020 | |
closing |
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 http = require("http"); | |
var server = http.createServer(); | |
server.listen( 3020, "0.0.0.0", function () { | |
console.log("Server listening on 3020"); | |
server.on("request", function (req, res) { | |
res.end("shutting down"); | |
console.log("closing"); | |
server.close( function() { | |
console.log("closed"); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment