Handle orphaned node process EADDRINUSE gracefully (and recover)
Current workaround as documented in the readme:
[2015-01-24 17:51:54:375] info - Pulse Process | Pulse REST API is ready.
events.js:85
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at exports._errnoException (util.js:742:11)
at Server._listen2 (net.js:1148:14)
at listen (net.js:1170:10)
at net.js:1253:9
at dns.js:82:18
at process._tickCallback (node.js:343:11)
This is the point when NodeSocket attemtps to create the web socket connection.
Check that a node process has not been left on port 8000 with:
lsof -i tcp:8000
If it has, you’ll get something like this back:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 54866 aral 18u IPv4 0xaa9f31e18a8024bb 0t0 TCP *:irdmi (LISTEN)
Then kill the PID e.g.
kill 54866