Examples of selectNow()


Examples of java.nio.channels.Selector.selectNow()

            if(tmpKey != null) {
                tmpKey.cancel();
            }
            if(readSelector != null) {// Bug 6403933
                try {
                    readSelector.selectNow();
                } catch (IOException e) {
                    ;
                }
                selectorFactory.returnSelector(readSelector);
            }
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

        try {
            ssc.configureBlocking(false);
            selector = Selector.open();
            SelectionKey key = ssc.register(selector, SelectionKey.OP_ACCEPT);
           
            int selected = selector.selectNow();
            if (selected == 0) {
                // no connection immediately accepted, let them try again
                throw context.getRuntime().newErrnoEAGAINError("Resource temporarily unavailable");
            } else {
                try {
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

           }
          
           if (pending.isEmpty() && unselectable_reads.isEmpty() && unselectable_writes.isEmpty()) {
               if (has_timeout) {
                   if (timeout==0) {
                       selector.selectNow();
                   } else {
                       selector.select(timeout);                      
                   }
               } else {
                   selector.select();
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

                   }
               } else {
                   selector.select();
               }
           } else {
               selector.selectNow();              
           }
          
           List r = new ArrayList();
           List w = new ArrayList();
           List e = new ArrayList();
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

                tmpKey.cancel();
            }

            if (readSelector != null) {
                try {
                    readSelector.selectNow();
                } catch (IOException ex) {
                    ;
                }

                SelectorFactory.returnSelector(readSelector);
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

        tmpKey.cancel();
        tmpKey = null;
      }
      if (writeSelector != null) {
        try {
          writeSelector.selectNow();
        } catch (IOException e) {
          log.error("Temp selector selectNow error", e);
        }
        // return selector
        SelectorFactory.returnSelector(writeSelector);
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

        tmpKey.cancel();
        tmpKey = null;
      }
      if (writeSelector != null) {
        // Cancel the key.
        writeSelector.selectNow();
        SelectorFactory.returnSelector(writeSelector);
      }
    }
    this.scheduleWritenBytes.addAndGet(0 - bytesProduced);
    return message.getMessage();
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

        tmpKey.cancel();
        tmpKey = null;
      }
      if (readSelector != null) {
        // Cancel the key.
        readSelector.selectNow();
        SelectorFactory.returnSelector(readSelector);
      }
    }
    return n;
  }
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

  }

  final void selectNow() throws IOException {
    final Selector selector = this.selector;
    if (selector != null) {
      selector.selectNow();
    }
  }
}
View Full Code Here

Examples of java.nio.channels.Selector.selectNow()

            thread.executeBlockingTask(new RubyThread.BlockingTask() {
                public void run() throws InterruptedException {
                    try {
                        if (!blocking) {
                            result[0] = selector.selectNow();
                            if (result[0] == 0) {
                                if ((operations & SelectionKey.OP_READ) != 0 && (operations & SelectionKey.OP_WRITE) != 0) {
                                    if (key.isReadable()) {
                                        writeWouldBlock();
                                    } else if (key.isWritable()) {
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.