Examples of IAsyncFuture


Examples of com.ibm.io.async.IAsyncFuture

    }

    public void write(Packet packet) throws IOException {
        ByteBuffer data = ((ByteBufferPacket)packet).getByteBuffer();
        while( data.hasRemaining() ) {
          IAsyncFuture future = socketChannel.write(data);
          try {
              future.getByteCount();
          } catch (InterruptedException e) {
              throw new InterruptedIOException();
          }
        }
    }
View Full Code Here

Examples of com.ibm.io.async.IAsyncFuture

    public void flush() throws IOException {
    }

    public void futureCompleted(IAbstractAsyncFuture abstractFuture, Object attribute) {
        IAsyncFuture future = (IAsyncFuture)abstractFuture;
        try {
           
            if( inputByteBuffer.position()>0 ) {
              ByteBuffer remaining = inputByteBuffer.slice();           
              Packet data = new ByteBufferPacket(((ByteBuffer)inputByteBuffer.flip()).slice());
View Full Code Here

Examples of com.ibm.io.async.IAsyncFuture

           
            if( inputByteBuffer==null || !inputByteBuffer.hasRemaining() ) {
                inputByteBuffer = allocateBuffer();
            }

            IAsyncFuture future = socketChannel.read(inputByteBuffer);
            future.addCompletionListener(this, null, false);
           
        } catch (InterruptedException e) {
            throw new InterruptedIOException();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.