@Override protected void doWriteBytes(ByteBuf buf) throws Exception { OutputStream os = this.os; if (os == null) { throw new NotYetConnectedException(); } buf.readBytes(os, buf.readableBytes()); }
@Override protected void doWriteBytes(ByteBuf buf) throws Exception { OutputStream os = this.os; if (os == null) { throw new NotYetConnectedException(); } buf.readBytes(os, buf.readableBytes()); }
@Override protected void doWriteBytes(ByteBuf buf) throws Exception { OutputStream os = this.os; if (os == null) { throw new NotYetConnectedException(); } buf.readBytes(os, buf.readableBytes()); }
synchronized private void checkOpenConnected() throws ClosedChannelException { if (!isOpen()) { throw new ClosedChannelException(); } if (!isConnected()) { throw new NotYetConnectedException(); } }
public static int ioResult(String method, int err, NativeIoException resetCause, ClosedChannelException closedCause) throws IOException { // network stack saturated... try again later if (err == ERRNO_EAGAIN_NEGATIVE || err == ERRNO_EWOULDBLOCK_NEGATIVE) { return 0; } if (err == resetCause.expectedErr()) { throw resetCause; } if (err == ERRNO_EBADF_NEGATIVE) { throw closedCause; } if (err == ERRNO_ENOTCONN_NEGATIVE) { throw new NotYetConnectedException(); } if (err == ERRNO_ENOENT_NEGATIVE) { throw new FileNotFoundException(); } // TODO: We could even go further and use a pre-instantiated IOException for the other error codes, but for // all other errors it may be better to just include a stack trace. throw newIOException(method, err); }
@Override protected void doWriteFileRegion(FileRegion region) throws Exception { OutputStream os = this.os; if (os == null) { throw new NotYetConnectedException(); } if (outChannel == null) { outChannel = Channels.newChannel(os); } long written = 0; for (;;) { long localWritten = region.transferTo(outChannel, written); if (localWritten == -1) { checkEOF(region); return; } written += localWritten; if (written >= region.count()) { return; } } }
private void checkOpenConnected() throws IOException { checkOpen(); if (!isConnected()) { throw new NotYetConnectedException(); } }
private ChannelFuture writeLastChunk() { if (!requestHeaderWritten) { return failedFuture(this, new NotYetConnectedException()); } else { return realChannel.write(HttpChunk.LAST_CHUNK); } }
@Override protected void doWriteFileRegion(FileRegion region) throws Exception { OutputStream os = this.os; if (os == null) { throw new NotYetConnectedException(); } if (outChannel == null) { outChannel = Channels.newChannel(os); } long written = 0; for (;;) { long localWritten = region.transferTo(outChannel, written); if (localWritten == -1) { checkEOF(region); return; } written += localWritten; if (written >= region.count()) { return; } } }
public static int ioResult(String method, int err, NativeIoException resetCause, ClosedChannelException closedCause) throws IOException { // network stack saturated... try again later if (err == ERRNO_EAGAIN_NEGATIVE || err == ERRNO_EWOULDBLOCK_NEGATIVE) { return 0; } if (err == resetCause.expectedErr()) { throw resetCause; } if (err == ERRNO_EBADF_NEGATIVE) { throw closedCause; } if (err == ERRNO_ENOTCONN_NEGATIVE) { throw new NotYetConnectedException(); } if (err == ERRNO_ENOENT_NEGATIVE) { throw new FileNotFoundException(); } // TODO: We could even go further and use a pre-instantiated IOException for the other error codes, but for // all other errors it may be better to just include a stack trace. throw newIOException(method, err); }
@Override protected void doWriteFileRegion(FileRegion region) throws Exception { OutputStream os = this.os; if (os == null) { throw new NotYetConnectedException(); } if (outChannel == null) { outChannel = Channels.newChannel(os); } long written = 0; for (;;) { long localWritten = region.transferTo(outChannel, written); if (localWritten == -1) { checkEOF(region); return; } written += localWritten; if (written >= region.count()) { return; } } }
case OPEN: case BOUND: throw new NotYetConnectedException(); case CLOSED: throw DO_WRITE_CLOSED_CHANNEL_EXCEPTION;
case OPEN: case BOUND: throw new NotYetConnectedException(); case CLOSED: throw DO_WRITE_CLOSED_CHANNEL_EXCEPTION;
throw new NotYetConnectedException();
throw new NotYetConnectedException();
case OPEN: case BOUND: throw new NotYetConnectedException(); case CLOSED: throw DO_WRITE_CLOSED_CHANNEL_EXCEPTION;
void writeReal(final ChannelBuffer a, final ChannelFuture future) { if (!requestHeaderWritten) { throw new NotYetConnectedException(); } final int size = a.readableBytes(); final ChannelFuture f; if (size == 0) { f = realChannel.write(ChannelBuffers.EMPTY_BUFFER); } else { f = realChannel.write(new DefaultHttpChunk(a)); } f.addListener(new ChannelFutureListener() { public void operationComplete(ChannelFuture f) { if (f.isSuccess()) { future.setSuccess(); if (size != 0) { fireWriteComplete(HttpTunnelingClientSocketChannel.this, size); } } else { future.setFailure(f.getCause()); } } }); }
cause = new NotYetConnectedException(); } else { cause = new ClosedChannelException(); cause = new NotYetConnectedException(); } else { cause = new ClosedChannelException();
cause = new NotYetConnectedException(); } else { cause = new ClosedChannelException();
throw new NotYetConnectedException();