@Override public boolean isAvailable() { return KQueue.isAvailable(); }
@Override public Throwable unavailabilityCause() { return KQueue.unavailabilityCause(); }
/** * The native socket transport for BSD systems such as MacOS using JNI. */ public static boolean isNativeKQueueAvailable() { return KQueue.isAvailable(); } }
@Override public Throwable unavailabilityCause() { return KQueue.unavailabilityCause(); }
/** * The native socket transport for BSD systems such as MacOS using JNI. */ public static boolean isNativeKQueueAvailable() { return KQueue.isAvailable(); } }
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 { LOG.debug("Using NIO for Netty transport."); return NettyTransportType.NIO; } }
channelClazz = EpollSocketChannel.class; logger.debug("Connector " + this + " using native epoll"); } else if (useKQueue && KQueue.isAvailable()) { if (useGlobalWorkerPool) { group = SharedEventLoopGroup.getInstance((threadFactory -> new KQueueEventLoopGroup(remotingThreads, threadFactory)));
@Override public boolean isAvailable() { return KQueue.isAvailable(); }
/** * The native socket transport for BSD systems such as MacOS using JNI. */ public static boolean isNativeKQueueAvailable() { return KQueue.isAvailable(); } }
/** * The native socket transport for BSD systems such as MacOS using JNI. */ public static boolean isNativeKQueueAvailable() { return KQueue.isAvailable(); } }
public static Class<? extends SocketChannel> socketChannel() { return EPOLL ? EpollSocketChannel.class : KQueue.isAvailable() ? KQueueSocketChannel.class : NioSocketChannel.class; }
public static Class<? extends ServerSocketChannel> serverSocketChannel() { return EPOLL ? EpollServerSocketChannel.class : KQueue.isAvailable() ? KQueueServerSocketChannel.class : NioServerSocketChannel.class; }
public Class<? extends Channel> getClientChannel() { if (useNativeIo && Epoll.isAvailable()) { return uds ? EpollDomainSocketChannel.class : EpollSocketChannel.class; } else if (useNativeIo && KQueue.isAvailable()) { return uds ? KQueueDomainSocketChannel.class : KQueueSocketChannel.class; } return NioSocketChannel.class; }
public static TransportType bestType() { if (Epoll.isAvailable()) { return EPOLL; } else if (KQueue.isAvailable()) { return KQUEUE; } else { return NIO; } }
public Class<? extends ServerChannel> getServerChannel() { if (useNativeIo && Epoll.isAvailable()) { return uds ? EpollServerDomainSocketChannel.class : EpollServerSocketChannel.class; } else if (useNativeIo && KQueue.isAvailable()) { return uds ? KQueueServerDomainSocketChannel.class : KQueueServerSocketChannel.class; } return NioServerSocketChannel.class; }
public Connector(int port) { this(port, useNativeIo && (Epoll.isAvailable() || KQueue.isAvailable())); }
public static EventLoopGroup eventLoopGroup(int threads) { return EPOLL ? new EpollEventLoopGroup(threads) : KQueue.isAvailable() ? new KQueueEventLoopGroup(threads) : new NioEventLoopGroup(threads); }
public static EventLoopGroup eventLoopGroup(int threads, ThreadFactory threadFactory) { return EPOLL ? new EpollEventLoopGroup(threads, threadFactory) : KQueue.isAvailable() ? new KQueueEventLoopGroup(threads, threadFactory) : new NioEventLoopGroup(threads, threadFactory); }
@Override public void start() throws InterruptedException { LOGGER.info("Starting the Unix Domain Socket server"); if(Epoll.isAvailable()) { LOGGER.debug("On Linux - using Epoll"); this.unixSocketServer = this.createChannel( EpollServerDomainSocketChannel.class, new EpollEventLoopGroup(), new EpollEventLoopGroup() ); } else if (KQueue.isAvailable()) { LOGGER.debug("On MacOS - using KQueue"); this.unixSocketServer = this.createChannel( KQueueServerDomainSocketChannel.class, new KQueueEventLoopGroup(), new KQueueEventLoopGroup() ); } }
@Override public void start() throws InterruptedException { LOGGER.info("Starting the Unix Domain Socket server"); if(Epoll.isAvailable()) { LOGGER.debug("On Linux - using Epoll"); this.unixSocketServer = this.createChannel( EpollServerDomainSocketChannel.class, new EpollEventLoopGroup(), new EpollEventLoopGroup() ); } else if (KQueue.isAvailable()) { LOGGER.debug("On MacOS - using KQueue"); this.unixSocketServer = this.createChannel( KQueueServerDomainSocketChannel.class, new KQueueEventLoopGroup(), new KQueueEventLoopGroup() ); } }