I've written a server application in node.js which receives inbound error messages from some hardware using socket.io and an RS232 wireless device.
My server has been receiving error messages perfectly for the past 2 months, but for the last 2 days the server has been randomly locking up and won't respond to any inbound messages until Ctrl + C is pressed in the terminal. I would normally expect this to shut the server down, but when the server blocks, Ctrl + C has been unblocking the event loop and then processing inbound messages that seemed to be queued whilst the event loop was blocked (this is only a theory).
I believe my theory to be correct because the console will hang at a message such as waiting for data... and then pressing Ctrl + C later will batch process 15 requests to push data to my back end.
Initially I can't spot any problems in my code and I'm more baffled due to the application running without problems for 2 months. My question here is, are there any easy to use profiling tools to see where exactly my server application is freezing?
socket.on('data', ...method. I don't use try/catch. However, when the data comes in I log the data thats in the buffer. When the server locks no buffer is printed but upon pressing Ctrl C it does.