@Override public void setTimeout(final int millis) throws IOException { request.setTimeout(millis); response.setTimeout(millis); this.timeout = millis; }
@Override public void consume() throws IOException { socketIn.consume(); } }
@Override public void setTimeout(final long value, final TimeUnit timeUnit) { in.setTimeout((int) TimeUnit.MILLISECONDS.convert(value, timeUnit)); out.setTimeout((int) TimeUnit.MILLISECONDS.convert(value, timeUnit)); timeoutMillis = TimeUnit.MILLISECONDS.convert(value, timeUnit); }
@Override public void write(final byte[] b) throws IOException { write(b, 0, b.length); }
public void setTimeout(final int timeout) { socketOutStream.setTimeout(timeout); }
@Override public int available() throws IOException { if (bufferedByte != null) { return 1; } isDataAvailable(); // attempt to read from socket return (bufferedByte == null) ? 0 : 1; }
@Override public void close() throws IOException { socketChannelOutput.close(); }
public void setTimeout(final int millis) { socketIn.setTimeout(millis); }
public SocketChannelCommunicationsSession(final SocketChannel socketChannel) throws IOException { super(); request = new SocketChannelInput(socketChannel); response = new SocketChannelOutput(socketChannel); channel = socketChannel; socketChannel.configureBlocking(false); }
public ByteBuffer prepareForWrite(final int requiredSize) { ensureSize(requiredSize); if (direction == Direction.READ) { direction = Direction.WRITE; buffer.position(buffer.limit()); } buffer.limit(buffer.capacity()); return buffer; }
@Override public void flush() throws IOException { socketChannelOutput.flush(); updateLastUsed(); } };
@Override public int read(final byte[] b) throws IOException { return read(b, 0, b.length); }
@Override public boolean isDataAvailable() { return request.isDataAvailable(); }
@Override public long getBytesWritten() { return response.getBytesWritten(); }
@Override public long getBytesRead() { return request.getBytesRead(); }
@Override protected void write(byte[] data) throws IOException { socketChannelOutput.write(data); }
@Override public void write(int b) throws IOException { socketChannelOutput.write(b); }
@Override public void write(byte[] b, int off, int len) throws IOException { socketChannelOutput.write(b, off, len); }
@Override public void write(byte[] b) throws IOException { socketChannelOutput.write(b); }