Examples of keyFor()


Examples of java.nio.channels.SocketChannel.keyFor()

                    if ( key == null ) return;
                    NioChannel nch = key.getChannel();
                    if ( nch == null ) return;
                    SocketChannel ch = nch.getIOChannel();
                    if ( ch == null ) return;
                    SelectionKey sk = ch.keyFor(selector);
                    try {
                        if (sk == null) {
                            sk = ch.register(selector, ops, key);
                            ref.key = sk;
                        } else if (!sk.isValid()) {
View Full Code Here

Examples of java.nio.channels.SocketChannel.keyFor()

                    if ( key == null ) return;
                    NioChannel nch = key.getChannel();
                    if ( nch == null ) return;
                    SocketChannel ch = nch.getIOChannel();
                    if ( ch == null ) return;
                    SelectionKey sk = ch.keyFor(selector);
                    try {
                        if (sk == null) {
                            if (SelectionKey.OP_WRITE==(ops&SelectionKey.OP_WRITE)) countDown(key.getWriteLatch());
                            if (SelectionKey.OP_READ==(ops&SelectionKey.OP_READ))countDown(key.getReadLatch());
                        } else {
View Full Code Here

Examples of java.nio.channels.spi.AbstractSelectableChannel.keyFor()

             // process cancellation
          
            AbstractSelectableChannel  canceled_channel = (AbstractSelectableChannel)obj;
 
            try{
              SelectionKey key = canceled_channel.keyFor( selector );
             
              if( key != null ){
               
                key.cancel()//cancel the key, since already registered
              }
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.