java - What Exception to use to detect host/reciever has gone down/failed? -


I have created a TCP server-client application in Java that exchanges periodic messages between them. As part of the failure management, I have to find out the host / client's failure and then call my custom function. Which exception in Java will only catch this part? Will socket expansion work here? I want to call failure management when the host / client goes down and not on any other issue.

You need to differentiate between servers (resulting in shutdown, as a result) The server is not available when the connection is started, and the server is going offline (a network cable is being removed). It usually appears with one or the same.

I will run a process and try to try all the scenarios that you want to handle. You have to deal with different timeouts for clear disconnection etc.

Comments