@Override public <A> void read(ByteBuffer dst, A attachment, CompletionHandler<Integer, ? super A> handler) { this.read(dst, 0L, TimeUnit.MILLISECONDS, attachment, handler); }
int cnt = 0; if ( keycount > 0 ) { //only read if we were registered for a read cnt = socket.read(buf); if (cnt == -1) throw new EOFException(); read += cnt;
int cnt = 0; if ( keycount > 0 ) { //only read if we were registered for a read cnt = socket.read(buf); if (cnt == -1) throw new EOFException(); read += cnt;
int cnt = 0; if ( keycount > 0 ) { //only read if we were registered for a read cnt = socket.read(buf); if (cnt == -1) throw new EOFException(); read += cnt;
int cnt = 0; if ( keycount > 0 ) { //only read if we were registered for a read cnt = socket.read(buf); if (cnt == -1) throw new EOFException(); read += cnt;
int cnt = 0; if ( keycount > 0 ) { //only read if we were registered for a read cnt = socket.read(buf); if (cnt == -1) { if (read == 0) {
int cnt = 0; if ( keycount > 0 ) { //only read if we were registered for a read cnt = socket.read(buf); if (cnt == -1) throw new EOFException(); read += cnt;
private int fillReadBuffer(boolean block, ByteBuffer to) throws IOException { int nRead; NioChannel channel = getSocket(); if (block) { Selector selector = null; try { selector = pool.get(); } catch (IOException x) { // Ignore } try { NioEndpoint.NioSocketWrapper att = (NioEndpoint.NioSocketWrapper) channel .getAttachment(); if (att == null) { throw new IOException("Key must be cancelled."); } nRead = pool.read(to, channel, selector, att.getReadTimeout()); } finally { if (selector != null) { pool.put(selector); } } } else { nRead = channel.read(to); if (nRead == -1) { throw new EOFException(); } } return nRead; }
nRead = socketWrapper.getSocket().read(readBuffer);
while(!timedout) { if (keycount > 0) { //only read if we were registered for a read read = socket.read(buf); if (read == -1) throw new EOFException();
while ( (!timedout) && read == 0) { if (keycount > 0) { //only read if we were registered for a read int cnt = socket.read(buf); if (cnt == -1) throw new EOFException();
nRead = socket.read(socket.getBufHandler().getReadBuffer());
nRead = socket.read(socket.getBufHandler().getReadBuffer());
nRead = socket.read(socket.getBufHandler().getReadBuffer());
nRead = socket.read(socket.getBufHandler().getReadBuffer());
private int fillReadBuffer(boolean block) throws IOException { int nRead; if (block) { Selector selector = null; try { selector = pool.get(); } catch ( IOException x ) { // Ignore } try { NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment) channel.getAttachment(false); if (att == null) { throw new IOException("Key must be cancelled."); } nRead = pool.read(channel.getBufHandler().getReadBuffer(), channel, selector, att.getTimeout()); } catch (EOFException eof) { nRead = -1; } finally { if (selector != null) { pool.put(selector); } } } else { nRead = channel.read(channel.getBufHandler().getReadBuffer()); } return nRead; } }
nRead = socket.read(socket.getBufHandler().getReadBuffer());
private int fillReadBuffer(boolean block) throws IOException { int nRead; if (block) { Selector selector = null; try { selector = pool.get(); } catch ( IOException x ) { // Ignore } try { NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment) nioChannel.getAttachment(false); if (att == null) { throw new IOException("Key must be cancelled."); } nRead = pool.read(nioChannel.getBufHandler().getReadBuffer(), nioChannel, selector, att.getTimeout()); } catch (EOFException eof) { nRead = -1; } finally { if (selector != null) { pool.put(selector); } } } else { nRead = nioChannel.read(nioChannel.getBufHandler().getReadBuffer()); } return nRead; }
nRead = socket.read(socket.getBufHandler().getReadBuffer());
nRead = socket.read(socket.getBufHandler().getReadBuffer());