Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.corundumstudio.socketio.listener.DefaultExceptionListener (DefaultExceptionListener.java:57) - Connection reset by peer #308

Closed
rachelxj opened this issue Jan 14, 2016 · 6 comments

Comments

@rachelxj
Copy link

I got a lot of this exception when I use version 1.6.7, any idea what will cause it?
ERROR [nioEventLoopGroup-3-2] com.corundumstudio.socketio.listener.DefaultExceptionListener (DefaultExceptionListener.java:57) - Connection reset by peer
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.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:881)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:241)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)

@mrniko
Copy link
Owner

mrniko commented Jan 15, 2016

This issue caused by closed connection from client side. Thus server attempts write to closed channel and gets this error.

@rachelxj
Copy link
Author

I checked isChannelOpen when I send message to client, is there any way I can avoid this exception?

@mrniko
Copy link
Owner

mrniko commented Jan 16, 2016

I checked isChannelOpen when I send message to client

This check is not enough because channel can be closed right after isChannelOpen method invocation.

@rachelxj
Copy link
Author

so does this mean I can't avoid this exception

@mrniko
Copy link
Owner

mrniko commented Jan 17, 2016

You are correct

@rachelxj
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants