java.net.Socket has a isClosed() method which returns true if the connection has been closed. I am using this method to reuse an existing connection to a server. Basically I am checking whether socket is closed before I reopen a connection and if isClosed() method returns true only I create the new connection or else reuse the existing one.
My Question is say I am connected to a server and the server crashes, will the isClosed() method return true, or it will only return true if the connection was closed in my code?