Example usage for java.nio.channels Selector selectNow

List of usage examples for java.nio.channels Selector selectNow

Introduction

In this page you can find the example usage for java.nio.channels Selector selectNow.

Prototype

public abstract int selectNow() throws IOException;

Source Link

Document

Selects a set of keys whose corresponding channels are ready for I/O operations.

Usage

From source file:com.alibaba.napoli.gecko.core.nio.impl.Reactor.java

private void clearCancelKeys() throws IOException {
    if (this.cancelledKeys > CLEANUP_INTERVAL) {
        final Selector selector = this.selector;
        selector.selectNow();
        this.cancelledKeys = 0;
    }// w w w  .  j  a  v a  2  s .  c o  m
}

From source file:com.alibaba.napoli.gecko.core.nio.impl.Reactor.java

final void selectNow() throws IOException {
    final Selector selector = this.selector;
    if (selector != null) {
        selector.selectNow();
    }//from   ww  w .j ava2s . c  o m
}