I create my client-server application, studying netty along the way. How to catch the server event of closing the channel by the client? In case of emergency or forced closing of the program on the client side, the server knows about it, and issues such a log:
java.io.IOException: Соединение разорвано другой стороной 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:349) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:112) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:571) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:512) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:426) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:398) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:805) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145) at java.lang.Thread.run(Thread.java:745)
But if you close the client side with the method ch.close(),ch.closeFuture().sync();
then nothing happens. How to track such an event?
Thanks in advance for your help.