One of our reqs is to use a backup server when the main server goes down. I simulated that by bringing down the server during an nio connection and testing what happens to my client.
My client has a main processing loop that look like this:
What I'm finding happens when I kill the server, the client will wake up immediately from the select (or when it arrives there) and will actually find key.isReadable() to evaluate to true. When I go to Read the socket, I get an IOException.
First, should I get a readable key? Second, is there a test I can do when I wake up from the select to make sure the host is still there? For instance, can I check anything on the socket or the channel to determine if the host has dropped?
[ November 29, 2004: Message edited by: N Goldsmith ] [ November 29, 2004: Message edited by: N Goldsmith ]