if (socket.flush(true,selector,writeTimeout)) break; }while ( true ); }finally {
if (socket.flush(true,selector,writeTimeout)) break; }while ( true ); }finally {
if (socket.flush(true,selector,writeTimeout,lastWrite)) break; }while ( true ); }finally {
@Override protected void doFlush() throws IOException { NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment) channel.getAttachment(false); if (att == null) { throw new IOException("Key must be cancelled"); } long writeTimeout = att.getWriteTimeout(); Selector selector = null; try { selector = pool.get(); } catch ( IOException x ) { //ignore } try { do { if (channel.flush(true, selector, writeTimeout)) { break; } } while (true); } finally { if (selector != null) { pool.put(selector); } } }
@Override public void flush() throws IOException { NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment) nioChannel.getAttachment(false); if (att == null) { throw new IOException("Key must be cancelled"); } long writeTimeout = att.getTimeout(); Selector selector = null; try { selector = pool.get(); } catch ( IOException x ) { //ignore } try { do { if (nioChannel.flush(true, selector, writeTimeout)) { break; } } while (true); } finally { if (selector != null) { pool.put(selector); } } }
if (socket.flush(true,selector,writeTimeout,lastWrite)) break; }while ( true ); }finally {
if (socket.flush(true,selector,writeTimeout,lastWrite)) break; }while ( true ); }finally {
@Override protected void doWrite(boolean block, ByteBuffer from) throws IOException { long writeTimeout = getWriteTimeout(); Selector selector = null; try { selector = pool.get(); } catch (IOException x) { // Ignore } try { pool.write(from, getSocket(), selector, writeTimeout, block); if (block) { // Make sure we are flushed do { if (getSocket().flush(true, selector, writeTimeout)) { break; } } while (true); } updateLastWrite(); } finally { if (selector != null) { pool.put(selector); } } // If there is data left in the buffer the socket will be registered for // write further up the stack. This is to ensure the socket is only // registered for write once as both container and user code can trigger // write registration. }