Exception handling on server socket close