This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Description
This script (obviously) creates a server and listens on a unix socket.
var server,
net = require( "net" );
server = net.createServer()
server.listen( "/usr/lib/example", function () {
console.log( "listening" )
process.exit()
} )
But when the process exits, if I run the same script again, I get
-> ~ node unix-test.js
Error: listen EADDRINUSE
Calling server.close() before process.exit() fixes it, but if the process crashes without giving me a chance to close the server, or if I use Control C to exit, I can no longer listen to that address.
Running rm /usr/lib/example fixes it, but that's a lot of extra work every time if you have to do it often