I have a situation where I have multiple connections to a number of servers and I wish to use NIO for this.
The Selector will tell me when there is data to read. Is there any way to know when a connection is no longer connected? Maybe when a write fails or by catching an exception that is thrown at some operation? I need this to be non-blocking and I want to do this in a way that the Channel can be re-established (i.e. a new channel to the same server is established) if the connection fails.