Example usage for io.netty.channel.epoll Native offsetofEpollData

List of usage examples for io.netty.channel.epoll Native offsetofEpollData

Introduction

In this page you can find the example usage for io.netty.channel.epoll Native offsetofEpollData.

Prototype

public static native int offsetofEpollData();

Source Link

Usage

From source file:com.mpush.netty.client.NettyTCPClient.java

License:Apache License

private boolean useNettyEpoll() {
    if (CC.mp.core.useNettyEpoll()) {
        try {// www .j a v  a 2s.  c  om
            Native.offsetofEpollData();
            return true;
        } catch (UnsatisfiedLinkError error) {
            LOGGER.warn("can not load netty epoll, switch nio model.");
        }
    }
    return false;
}

From source file:com.mpush.netty.server.NettyTCPServer.java

License:Apache License

protected boolean useNettyEpoll() {
    if (CC.mp.core.useNettyEpoll()) {
        try {/*from  ww  w .  j  av a  2  s .  c o m*/
            Native.offsetofEpollData();
            return true;
        } catch (UnsatisfiedLinkError error) {
            logger.warn("can not load netty epoll, switch nio model.");
        }
    }
    return false;
}