netty IOException: Connection reset by peer 错误 log 屏蔽办法

前端之家收集整理的这篇文章主要介绍了netty IOException: Connection reset by peer 错误 log 屏蔽办法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

err log 如下

java.io.IOException: Connection reset by peer

at sun.nio.ch.FileDispatcherImpl.read0(Native Method)

at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)

at sun.nio.ch.IoUtil.readIntoNativeBuffer(IoUtil.java:223)

at sun.nio.ch.IoUtil.read(IoUtil.java:192)

at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)

at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)

at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)

at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372)

at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)

at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)

at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)

at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)

at java.lang.Thread.run(Thread.java:748)

出现这个错误原因就不多说了,网上一搜基本都出来了,其实也无关紧要。但是一直打印 err log 也是个很烦的事情
解决方法如下:
Handler.java中 重写 exceptionCaught

原文链接:https://www.f2er.com/note/413496.html

猜你在找的程序笔记相关文章