Did you check if any "socket.close()" actually goes through and changes the socket's state? If the first one throws exception (with information that might be the clue), execution would immediately go to the finally block and the stack traces would look the same.