How to make exceptions (like channel closed exceptions) reach the sending code.

王福强 fujohnwang at gmail.com
Tue Jun 1 08:57:51 EDT 2010


Since there was such a topic before, I would like to post a similar question
here, Hope you experts can help to clear my head.

most of the sample code will close the channel in exceptionCaught() method,
but I want to know what is the best practice with this?
1- if we catch exception in this method, what we do with it? throw out? or
just logging? or we can do more with it? as I know, if I want to do more
with the exception, maybe I have to refer to some larger scope object
reference.
2- if I close the channel, when this action can influence the
messageReceived() action, why i ask this is that I found even I have called
the close() method of channel in exceptionCaught(), the messageReceived()
keep receiving packets, can u explained this behavior for me? thanks in
advance. 
btw. I use OioClientSocketChannelFactory and work as a client that connect
to some server.


-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/How-to-make-exceptions-like-channel-closed-exceptions-reach-the-sending-code-tp4632305p5125840.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list