Better netty transport initialization
diff --git a/utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java b/utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
index b378f3a..2f3e039 100644
--- a/utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
+++ b/utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
@@ -18,7 +18,6 @@
import io.netty.channel.EventLoopGroup;
import io.netty.channel.ServerChannel;
import io.netty.channel.SimpleChannelInboundHandler;
-import io.netty.channel.epoll.Epoll;
import io.netty.channel.epoll.EpollEventLoopGroup;
import io.netty.channel.epoll.EpollServerSocketChannel;
import io.netty.channel.epoll.EpollSocketChannel;
@@ -64,18 +63,13 @@
// try Epoll first and if that does work, use nio.
// TODO: make this configurable.
try {
- if (Epoll.isAvailable()) {
- clientGroup = new EpollEventLoopGroup();
- serverGroup = new EpollEventLoopGroup();
- serverChannelClass = EpollServerSocketChannel.class;
- clientChannelClass = EpollSocketChannel.class;
- return;
- } else {
- log.info("Netty epoll support is not available. Proceeding with nio.");
- }
-
+ clientGroup = new EpollEventLoopGroup();
+ serverGroup = new EpollEventLoopGroup();
+ serverChannelClass = EpollServerSocketChannel.class;
+ clientChannelClass = EpollSocketChannel.class;
+ return;
} catch (Throwable t) {
- log.warn("Failed to initialize epoll sockets. Proceeding with nio.", t);
+ log.warn("Failed to initialize native (epoll) transport. Proceeding with nio.", t);
}
clientGroup = new NioEventLoopGroup();
serverGroup = new NioEventLoopGroup();