Relative Content

Tag Archive for javasocketsexceptionnetworkingtimeout

how to decide if SocketTimeoutException means there is no connection

we have a retrofit java client to a server running in gui app, we want to notify the user if there is no connection to the server, there are some exceptions that are obvious like ConnectException or UnknownHostException etc.
but on timeouts we don’t want to do nothing , the next api call will probably succeed.
my main question is about SocketTimeoutException, when does it mean that the server is not reachable?
sometimes the message is ‘Connect timed out’ and sometimes its ‘timeout’