I have written a small program that interacts with a server on a specific port. The program works fine, but:
Once the program terminated unexpectedly, and ever since
It should be mentioned that the Socket instance in both client and the server end needs to explicitly invoke close(). If only one of the ends invokes close() then too, the socket will remain in CLOSE_WAIT state.
Socket
close()