public boolean wait_event (long timeout_) {
        
        int rc = 0;
        
        try {
            
            if (timeout_ == 0) {
                // wait_event(0) is called every read/send of SocketBase
                // instant readiness is not strictly required
                // On the other hand, we can save lots of system call and increase performance
                if (rcursor < wcursor.get()) {
                    return true;
                }
                
                return false;
            } else if (timeout_ < 0 ) {
                rc = selector.select(0);
            } else {
                rc = selector.select(timeout_);
            }
        } catch (IOException e) {
            throw new ZError.IOException(e);
        }


        if (rc == 0) {
            return false;
        }
        
        selector.selectedKeys().clear();
        
        return true;

    }