I am writing a proxy app in nodejs which handles thousands of concurrent connections inwards and outwards, I want to make sure all idle and unneeded and ... connections get closed properly and their file descriptors get released. If it leaks file descriptors, I would run out of them very fast. my question is that what is the best solution to make sure a connection gets closed ? socket.end() or socket.destroy() ? currently I am using socket.end() but in doc it says it half closes the connection, is there a situation that socket.end() doesnt result in closing a connection ? what I am interested in is releasing the file descriptors ASAP. So what do you suggest ?