开发者

Java NIO (Netty): Exceptionhandling in Downstream Hanlders/Chain

could someone please explain to me, how in netty "Downstream Exceptions" are handeled? According to the javadoc there are no Downstream exceptions:

http://docs.jboss.org/netty/3.1/api/org/jbo开发者_Python百科ss/netty/channel/ExceptionEvent.html

Given the case that in one of my downstream handlers an exception occures OR in the I/0 Thread itself, where can these errors be catched and handeled?

thank you very much tom


If an exception is raised in your handler, it always triggers an upstream exception event. It doesn't matter if the exception was raised by an upstream or a downstream handler.


It looks like SimpleChannelDownstreamHandler doesn't have any exception handling method, as you say. Could you rather use a plain old SimpleChannelHandler, and use a downstream method, like writeRequested(...)? (That is, just move your code to that method). Then you could use exceptionCaught(...) when it throws an exception.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜