Reconnect on Exception?

bantai superman at bantai.com
Wed Sep 2 14:42:03 EDT 2009


Hi,

The search function is not working for me so apologies if this has been
asked and answered in the past but I'm looking for an example of how to best
implement a reconnect feature.

I currently have a client and server passing object to each other but if I
restart the server the client dies and I have to restart this as well. I've
seen that I should implement the exceptionCaught method in the ClientHandler
but am unsure of how to best try and reconnect with the server once an
exception is caught.

So far since this is still in early development this is the only instance
I've seen where I am unable to continue sending objects but there may be
other times I need to reconnect (Channel could be down?) so I'm wondering if
I could achieve something like a reconnect mechanism using a
ChannelFutureListener since I can see when the Channel is closed but I've
not found a way to reconnect with the Objects that are passed to me in that
method.

Thanks for any help
-- 
View this message in context: http://n2.nabble.com/Reconnect-on-Exception-tp3568675p3568675.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list