When connecting to a server with a Java client socket I had this two different connection timeout exceptions.
Caused by: java.net.SocketTimeoutException: con
Caused by: java.net.SocketTimeoutException: connect timed out
When you are not able to connect due to unavailability of the peer. Your second query, what about read? Than you will get
Caused by: java.net.SocketTimeoutException: Read timed out
Third possibility connection refused if peer is active but refused the connection.