@Override public void failed(Throwable exc, ByteBuffer attachment) { IOException ioe; if (exc instanceof IOException) { ioe = (IOException) exc; } else { ioe = new IOException(exc); } setError(ioe); writePending.release(); endpoint.processSocket(Nio2SocketWrapper.this, SocketEvent.ERROR, true); } };
@Override public void failed(Throwable exc, ByteBuffer[] attachment) { IOException ioe; if (exc instanceof IOException) { ioe = (IOException) exc; } else { ioe = new IOException(exc); } setError(ioe); writePending.release(); endpoint.processSocket(Nio2SocketWrapper.this, SocketEvent.ERROR, true); } };
@Override public void failed(Throwable exc, SocketWrapperBase<Nio2Channel> attachment) { IOException ioe; if (exc instanceof IOException) { ioe = (IOException) exc; } else { ioe = new IOException(exc); } setError(ioe); if (exc instanceof AsynchronousCloseException) { // Release here since there will be no // notify/dispatch to do the release. readPending.release(); // If already closed, don't call onError and close again return; } getEndpoint().processSocket(attachment, SocketEvent.ERROR, true); } };
@Override public void failed(Throwable exc, OperationState<A> state) { IOException ioe; if (exc instanceof IOException) { ioe = (IOException) exc; } else { ioe = new IOException(exc); } setError(ioe); boolean notify = false; state.semaphore.release(); if (state.block == BlockingMode.BLOCK) { notify = true; } else { state.state = Nio2Endpoint.isInline() ? CompletionState.ERROR : CompletionState.DONE; } if (state.handler != null) { state.handler.failed(ioe, state.attachment); } if (notify) { synchronized (state) { state.state = Nio2Endpoint.isInline() ? CompletionState.ERROR : CompletionState.DONE; state.notify(); } } } }