Code example for SelectionKey

Methods: interestOpsselector

0
    public void enableRead() { 
        final Lock lock = this.keyLock;
        lock.lock();
        try { 
            SelectionKey key = this.processKey;
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        } finally { 
            lock.unlock();
        } 
        processKey.selector().wakeup();
    } 
 
    /** 
     * 关闭读事件 
     */ 
    public void disableRead() { 
        final Lock lock = this.keyLock;
        lock.lock();
        try { 
            SelectionKey key = this.processKey;
Stop searching for code, let great code find you!  Add Codota to your java IDE