691692693694695696697698699700701
* @return The number of bytes written, possibly zero */ @Override public Future<Integer> write(ByteBuffer src) { if (writePending) { throw new WritePendingException(); } else { writePending = true; } return new FutureWrite(src); }
795796797798799800801802803804805
if (closing || closed) { handler.failed(new IOException("Channel is in closing state."), attachment); return; } if (writePending) { throw new WritePendingException(); } else { writePending = true; } try {
929930931932933934935936937938939
if (closing || closed) { handler.failed(new IOException("Channel is in closing state."), attachment); return; } if (writePending) { throw new WritePendingException(); } else { writePending = true; } try { GatherState<A> state = new GatherState<>(srcs, offset, length,
145146147148149150151152153154155
{ case CLOSED: break loop; case UNREADY: throw new WritePendingException(); // TODO ? default: if (_state.compareAndSet(state,OutputState.CLOSED)) { try
178179180181182183184185186187188
235236237238239240241242243244245
new AsyncFlush().iterate(); return; case PENDING: case UNREADY: throw new WritePendingException(); case CLOSED: return; } break;
295296297298299300301302303304305
new AsyncWrite(b,off,len,complete).iterate(); return; case PENDING: case UNREADY: throw new WritePendingException(); case CLOSED: throw new EofException("Closed"); } break;
393394395396397398399400401402403
new AsyncWrite(buffer,complete).iterate(); return; case PENDING: case UNREADY: throw new WritePendingException(); case CLOSED: throw new EofException("Closed"); } break;
473474475476477478479480481482483
new AsyncFlush().iterate(); return; case PENDING: case UNREADY: throw new WritePendingException(); case CLOSED: throw new EofException("Closed"); } break;
328329330331332333334335336337338
{ if (DEBUG) LOG.debug("write: {} {}", this, BufferUtil.toDetailString(buffers)); if (!updateState(__IDLE,__WRITING)) throw new WritePendingException(); try { boolean flushed=_endPoint.flush(buffers); if (DEBUG)