@Override public void failed(Throwable exc, SocketWrapperBase<Nio2Channel> attachment) { endpoint.processSocket(attachment, SocketEvent.ERROR, false); } }
@Override public void failed(Throwable exc, SocketWrapperBase<Nio2Channel> attachment) { endpoint.processSocket(attachment, SocketEvent.ERROR, false); } }
@Override public void completed(Integer result, SocketWrapperBase<Nio2Channel> attachment) { if (result.intValue() < 0) { failed(new EOFException(), attachment); } else { endpoint.processSocket(attachment, SocketEvent.OPEN_READ, false); } } @Override
@Override public void completed(Integer result, SocketWrapperBase<Nio2Channel> attachment) { if (result.intValue() < 0) { failed(new EOFException(), attachment); } else { endpoint.processSocket(attachment, SocketEvent.OPEN_WRITE, false); } } @Override
@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 completed(Long nBytes, ByteBuffer[] attachment) { writeNotify = false; synchronized (writeCompletionHandler) { if (nBytes.longValue() < 0) { failed(new EOFException(sm.getString("iob.failedwrite")), attachment); } else if (!nonBlockingWriteBuffer.isEmpty() || arrayHasData(attachment)) { // Continue writing data using a gathering write nestedWriteCompletionCount.get().incrementAndGet(); ByteBuffer[] array = nonBlockingWriteBuffer.toArray(attachment); getSocket().write(array, 0, array.length, toNio2Timeout(getWriteTimeout()), TimeUnit.MILLISECONDS, array, gatheringWriteCompletionHandler); nestedWriteCompletionCount.get().decrementAndGet(); } else { // All data has been written if (writeInterest) { writeInterest = false; writeNotify = true; } writePending.release(); } } if (writeNotify && nestedWriteCompletionCount.get().get() == 0) { endpoint.processSocket(Nio2SocketWrapper.this, SocketEvent.OPEN_WRITE, Nio2Endpoint.isInline()); } }
endpoint.processSocket(Nio2SocketWrapper.this, SocketEvent.OPEN_WRITE, Nio2Endpoint.isInline());
socketWrapper.setSecure(isSSLEnabled()); return processSocket(socketWrapper, SocketEvent.OPEN_READ, true); } catch (Throwable t) { ExceptionUtils.handleThrowable(t);