@Override public void write(final Callback callback, final ByteBuffer... buffers) throws WritePendingException { _underlying.write(callback, buffers); }
@Override public void write(Callback callback, ByteBuffer... buffers) throws WritePendingException { _endp.write(callback, buffers); }
public void write(Callback callback, ByteBuffer... buffers) throws WritePendingException { _endp.write(callback,buffers); }
endPoint.write(callback, BufferUtil.EMPTY_BUFFER); break; case 1: endPoint.write(callback, header); break; case 2: endPoint.write(callback, chunk); break; case 3: endPoint.write(callback, header, chunk); break; case 4: endPoint.write(callback, content); break; case 5: endPoint.write(callback, header, content); break; case 6: endPoint.write(callback, chunk, content); break; case 7: endPoint.write(callback, header, chunk, content); break; default:
@Override public void write(final Callback callback, ByteBuffer... buffers) { EndPoint endPoint = getEndPoint(); endPoint.write(callback, buffers); }
private void blockingWrite(ByteBuffer... bytes) throws IOException { try { getEndPoint().write(_writeBlocker, bytes); _writeBlocker.block(); } catch (InterruptedException x) { throw (IOException)new InterruptedIOException().initCause(x); } catch (TimeoutException e) { throw new IOException(e); } }
private void blockingWrite(ByteBuffer... bytes) throws IOException { try { getEndPoint().write(_writeBlocker, bytes); _writeBlocker.block(); } catch (InterruptedException x) { throw (IOException)new InterruptedIOException().initCause(x); } catch (TimeoutException e) { throw new IOException(e); } }
/** * <p>Writes (with non-blocking semantic) the given buffer of data onto the given endPoint.</p> * * @param endPoint the endPoint to write to * @param buffer the buffer to write * @param callback the completion callback to invoke * @param context the context information related to the connection */ protected void write(EndPoint endPoint, ByteBuffer buffer, Callback callback, ConcurrentMap<String, Object> context) { if (LOG.isDebugEnabled()) LOG.debug("{} writing {} bytes", this, buffer.remaining()); endPoint.write(callback, buffer); }
private <C> void write(ByteBuffer buffer) { EndPoint endpoint = getEndPoint(); if (!isOpen()) { writeBytes.failAll(new IOException("Connection closed")); return; } try { endpoint.write(writeBytes,buffer); } catch (Throwable t) { writeBytes.failed(t); } } }
private <C> void write(ByteBuffer buffer) { EndPoint endpoint = getEndPoint(); if (!isOpen()) { writeBytes.failAll(new IOException("Connection closed")); return; } try { endpoint.write(writeBytes,buffer); } catch (Throwable t) { writeBytes.failed(t); } } }
endPoint.write(this, buffers.toArray(new ByteBuffer[buffers.size()])); buffers.clear(); return Action.SCHEDULED;
private <C> void write(ByteBuffer buffer, FrameBytes<C> frameBytes) { EndPoint endpoint = getEndPoint(); if (LOG_FRAMES.isDebugEnabled()) { LOG_FRAMES.debug("{} Writing {} frame bytes of {}",policy.getBehavior(),buffer.remaining(),frameBytes); } if (connectionState == ConnectionState.CLOSED) { // connection is closed, STOP WRITING, geez. return; } try { endpoint.write(frameBytes.context,frameBytes,buffer); } catch (Throwable t) { frameBytes.failed(frameBytes.context,t); } } }
private void writeGarbageThenCloseSocket() { response.getHttpOutput().getHttpChannel().getEndPoint().write(new Callback() { @Override public void succeeded() { try { socket.close(); } catch (IOException e) { e.printStackTrace(); } } @Override public void failed(Throwable x) { try { socket.close(); } catch (IOException e) { e.printStackTrace(); } } }, BufferUtil.toBuffer(GARBAGE)); }
@Override public void run() { URI uri = connectPromise.getRequest().getRequestURI(); request.setRequestURI(uri); String rawRequest = request.generate(); ByteBuffer buf = BufferUtil.toBuffer(rawRequest,StringUtil.__UTF8_CHARSET); getEndPoint().write(this,buf); }
@Override public void run() { URI uri = connectPromise.getRequest().getRequestURI(); request.setRequestURI(uri); String rawRequest = request.generate(); ByteBuffer buf = BufferUtil.toBuffer(rawRequest,StringUtil.__UTF8_CHARSET); getEndPoint().write(this,buf); }
endPoint.write(this, chunkBuffer); return Action.SCHEDULED;
getEndPoint().write(_writeCallback, _encryptedOutput);
getEndPoint().write(_writeCallback, _encryptedOutput);
connection.getEndPoint().write(new Callback() {