Example usage for io.netty.channel.kqueue KQueue isAvailable

List of usage examples for io.netty.channel.kqueue KQueue isAvailable

Introduction

In this page you can find the example usage for io.netty.channel.kqueue KQueue isAvailable.

Prototype

public static boolean isAvailable() 

Source Link

Document

Returns true if and only if the <a href="https://netty.io/wiki/native-transports.html"> netty-transport-native-kqueue </a> is available.

Usage

From source file:dorkbox.network.NativeLibrary.java

License:Apache License

/**
 * @return true if the (possibly) required native libraries have been loaded
 *//*  w  ww  .  ja v  a2 s . c om*/
public static boolean isAvailable() {
    if (!EndPoint.enableNativeLibrary) {
        return false;
    }

    if (OS.isLinux()) {
        return Epoll.isAvailable();
    } else if (OS.isMacOsX()) {
        return KQueue.isAvailable();
    }

    // not Linux/MacOsX
    return true;
}

From source file:io.vertx.core.net.impl.transport.KQueueTransport.java

License:Open Source License

@Override
public boolean isAvailable() {
    return KQueue.isAvailable();
}

From source file:org.apache.activemq.artemis.core.remoting.impl.netty.CheckDependencies.java

License:Apache License

public static final boolean isKQueueAvailable() {
    try {/*from w  w  w  . j  a  v  a2s  . c  o m*/
        return Env.isMacOs() && KQueue.isAvailable();
    } catch (Throwable e) {
        ActiveMQClientLogger.LOGGER.unableToCheckKQueueAvailability(e);
        return false;
    }
}

From source file:org.graylog2.inputs.transports.NettyTransportConfiguration.java

License:Open Source License

private NettyTransportType detectPlatform() {
    if (Epoll.isAvailable()) {
        LOG.debug("Using epoll for Netty transport.");
        return NettyTransportType.EPOLL;
    } else if (KQueue.isAvailable()) {
        LOG.debug("Using kqueue for Netty transport.");
        return NettyTransportType.KQUEUE;
    } else {//from w w  w. jav a 2 s .  c o  m
        LOG.debug("Using NIO for Netty transport.");
        return NettyTransportType.NIO;
    }
}