Don't unlink the socket, that's the responsibility of libuv and/or node.
var fs = require('fs');
var http = require('http');
-var SOCKET = common.tmpDir + '/http.sock';
-
var status_ok = false; // status code == 200?
var headers_ok = false;
var body_ok = false;
res.end();
});
-server.listen(SOCKET, function() {
+server.listen(common.PIPE, function() {
var options = {
- socketPath: SOCKET,
+ socketPath: common.PIPE,
path: '/'
};
});
-server.on('close', function() {
- try {
- fs.unlinkSync(SOCKET);
- } catch (e) {}
-});
-
process.on('exit', function() {
server.close();
assert.ok(status_ok);