@Override protected DatagramChannel javaChannel() { return (DatagramChannel) super.javaChannel(); }
@Override public InetSocketAddress localAddress() { return (InetSocketAddress) super.localAddress(); }
@Override public InetSocketAddress remoteAddress() { return (InetSocketAddress) super.remoteAddress(); }
@Override protected void doWrite(ChannelOutboundBuffer in) throws Exception { final SelectionKey key = selectionKey(); final int interestOps = key.interestOps(); for (int i = config().getWriteSpinCount() - 1; i >= 0; i--) { if (doWriteMessage(msg, in)) { done = true; break; if (continueOnWriteError()) { in.remove(e); } else {
@Override public void read() { assert eventLoop().inEventLoop(); final ChannelConfig config = config(); final ChannelPipeline pipeline = pipeline(); final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle(); allocHandle.reset(config); try { do { int localRead = doReadMessages(readBuf); if (localRead == 0) { break; closed = closeOnReadError(exception); if (isOpen()) { close(voidPromise());
@Override protected boolean closeOnReadError(Throwable cause) { // We do not want to close on SocketException when using DatagramChannel as we usually can continue receiving. // See https://github.com/netty/netty/issues/5893 if (cause instanceof SocketException) { return false; } return super.closeOnReadError(cause); } }
protected boolean closeOnReadError(Throwable cause) { if (!isActive()) { // If the channel is not active anymore for whatever reason we should not try to continue reading. return true; } if (cause instanceof PortUnreachableException) { return false; } if (cause instanceof IOException) { // ServerChannel should not be closed even on IOException because it can often continue // accepting incoming connections. (e.g. too many open files) return !(this instanceof ServerChannel); } return true; }
@Override public void read() { assert eventLoop().inEventLoop(); final ChannelConfig config = config(); final ChannelPipeline pipeline = pipeline(); final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle(); allocHandle.reset(config); try { do { int localRead = doReadMessages(readBuf); if (localRead == 0) { break; closed = closeOnReadError(exception); if (isOpen()) { close(voidPromise());
@Override protected void doWrite(ChannelOutboundBuffer in) throws Exception { final SelectionKey key = selectionKey(); final int interestOps = key.interestOps(); for (int i = config().getWriteSpinCount() - 1; i >= 0; i--) { if (doWriteMessage(msg, in)) { done = true; break; if (continueOnWriteError()) { in.remove(e); } else {
@Override protected boolean closeOnReadError(Throwable cause) { return super.closeOnReadError(cause); } }
protected boolean closeOnReadError(Throwable cause) { if (!isActive()) { // If the channel is not active anymore for whatever reason we should not try to continue reading. return true; } if (cause instanceof PortUnreachableException) { return false; } if (cause instanceof IOException) { // ServerChannel should not be closed even on IOException because it can often continue // accepting incoming connections. (e.g. too many open files) return !(this instanceof ServerChannel); } return true; }
@Override public void read() { assert eventLoop().inEventLoop(); final ChannelConfig config = config(); final ChannelPipeline pipeline = pipeline(); final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle(); allocHandle.reset(config); try { do { int localRead = doReadMessages(readBuf); if (localRead == 0) { break; closed = closeOnReadError(exception); if (isOpen()) { close(voidPromise());
@Override protected void doWrite(ChannelOutboundBuffer in) throws Exception { final SelectionKey key = selectionKey(); final int interestOps = key.interestOps(); for (int i = config().getWriteSpinCount() - 1; i >= 0; i--) { if (doWriteMessage(msg, in)) { done = true; break; if (continueOnWriteError()) { in.remove(e); } else {
@Override protected ServerSocketChannel javaChannel() { return (ServerSocketChannel) super.javaChannel(); }
@Override public InetSocketAddress localAddress() { return (InetSocketAddress) super.localAddress(); }
@Override public InetSocketAddress remoteAddress() { return (InetSocketAddress) super.remoteAddress(); }
@Override protected boolean closeOnReadError(Throwable cause) { // We do not want to close on SocketException when using DatagramChannel as we usually can continue receiving. // See https://github.com/netty/netty/issues/5893 if (cause instanceof SocketException) { return false; } return super.closeOnReadError(cause); } }
protected boolean closeOnReadError(Throwable cause) { if (!isActive()) { // If the channel is not active anymore for whatever reason we should not try to continue reading. return true; } if (cause instanceof PortUnreachableException) { return false; } if (cause instanceof IOException) { // ServerChannel should not be closed even on IOException because it can often continue // accepting incoming connections. (e.g. too many open files) return !(this instanceof ServerChannel); } return true; }
@Override public void read() { assert eventLoop().inEventLoop(); final ChannelConfig config = config(); final ChannelPipeline pipeline = pipeline(); final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle(); allocHandle.reset(config); try { do { int localRead = doReadMessages(readBuf); if (localRead == 0) { break; closed = closeOnReadError(exception); if (isOpen()) { close(voidPromise());
@Override protected void doWrite(ChannelOutboundBuffer in) throws Exception { final SelectionKey key = selectionKey(); final int interestOps = key.interestOps(); for (int i = config().getWriteSpinCount() - 1; i >= 0; i--) { if (doWriteMessage(msg, in)) { done = true; break; if (continueOnWriteError()) { in.remove(e); } else {