105106107108109110111112113
*/ public IoFuture<ByteBuffer, Void> read(CompletionHandler<ByteBuffer, Void> handler) { if (!readPending.compareAndSet(false, true)) { throw new ReadPendingException(); } return new Reader(handler).start(); }
649650651652653654655656657658659
/** Reads a message from the connection. */ @Override void read() { synchronized (readLock) { if (isReading) { throw new ReadPendingException(); } isReading = true; } asyncMsgChannel.read(this); }
697698699700701702703704705706707
107108109110111112113114115
5455565758596061626364
throw new IllegalArgumentException(); if (!_interested.compareAndSet(null, callback)) { LOG.warn("Read pending for {} prevented {}", _interested, callback); throw new ReadPendingException(); } try { if (needsFill()) fillable();
605606607608609610611612613614615
* @throws IllegalStateException if the handshake was not completed */ @Override public Future<Integer> read(ByteBuffer dst) { if (readPending) { throw new ReadPendingException(); } else { readPending = true; } //did we finish our handshake? if (!handshakeComplete)
783784785786787788789790791792793
if (closing || closed) { handler.completed(Integer.valueOf(-1), attachment); return; } if (readPending) { throw new ReadPendingException(); } else { readPending = true; } if (!handshakeComplete) { throw new IllegalStateException(sm.getString("channel.nio.ssl.incompleteHandshake"));
590591592593594595596597598599600
771772773774775776777778779780781
if (closing || closed) { handler.completed(Integer.valueOf(-1), attachment); return; } if (readPending) { throw new ReadPendingException(); } else { readPending = true; } //did we finish our handshake? if (!handshakeComplete)
5758596061626364656667
throw new IllegalArgumentException(); if (!_interested.compareAndSet(null,callback)) { LOG.warn("Read pending for "+_interested.get()+" pervented "+callback); throw new ReadPendingException(); } try { if (needsFill()) fillable();