@Override public void completeConnection(SelectionKey key) { // connection is done. Return the buffer to the pool SocketChannelAttachment attachment = (SocketChannelAttachment) key.attachment(); try { bufferPool.put(attachment.getByteBuffer()); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } currentConnections.decrementAndGet(); }
sslSocketChannel = attachment.getSslSocketChannel(); final ByteBuffer socketBuffer = attachment.getByteBuffer(); byte[] socketBufferArray = new byte[socketBuffer.limit()];
SocketChannelAttachment attachment = new SocketChannelAttachment(buffer, sslSocketChannel); readKey.attach(attachment); } else if (key.isReadable()) {
final ByteBuffer socketBuffer = attachment.getByteBuffer();