>> I've not done anything like this before in any programming task and >> am a bit lost when it comes to picturing what I need to do in terms >> of new functionality. The message to the server is written to the >> IOSession (set when the server connection is established), which >> then waits until a response is received before that response is >> processed. I'm guessing that it is here somewhere that I would need >> to add appropriate functionality. > > Yep. Mainly detect either a disconnection (and an Closed() event will > be fired), or use a timeout for the expected response, and if the > response has not been received, then retry, after having closed the > session and reconnected.
Many thanks for this, and for the example you included. The issue that I'm finding is that when I pull the network cable from the box I'm using, errors are being caught in the exceptionCaught() method of my IoHandlerAdapter implementation. This is fine for tidying up after oneself (e.g. closing the session), but I'm not sure how to propagate the exception from there back up to where the client is waiting for a response after writing the request to the session. I've tried to throw an InterruptedException from exceptionCaught() but it gets lost within the auspices of the thread somewhere. In the example given in svn.apache.org, the exceptionCaught() method doesn't seem to explicitly propagate any exception either, so I'm wondering whether I'm approaching the solution in the wrong way. Thanks for any thoughts, Mark
