Example usage for io.netty.channel.epoll EpollServerSocketChannel EpollServerSocketChannel

List of usage examples for io.netty.channel.epoll EpollServerSocketChannel EpollServerSocketChannel

Introduction

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

Prototype

public EpollServerSocketChannel() 

Source Link

Usage

From source file:org.graylog2.inputs.transports.netty.ServerSocketChannelFactory.java

License:Open Source License

@Override
public ServerSocketChannel newChannel() {
    switch (transportType) {
    case EPOLL:/* ww w . ja va  2  s.c om*/
        return new EpollServerSocketChannel();
    case KQUEUE:
        return new KQueueServerSocketChannel();
    case NIO:
        return new NioServerSocketChannel();
    default:
        throw new IllegalArgumentException("Invalid or unknown Netty transport type " + transportType);
    }
}

From source file:org.jupiter.transport.netty.TcpChannelProvider.java

License:Apache License

@SuppressWarnings("unchecked")
@Override/*from w  w  w. jav  a2 s.  c om*/
public T newChannel() {
    switch (kindChannel) {
    case ACCEPTOR:
        switch (typeIO) {
        case NIO:
            return (T) new NioServerSocketChannel();
        case NATIVE:
            return (T) new EpollServerSocketChannel();
        default:
            throw new IllegalStateException("invalid type IO: " + typeIO);
        }
    case CONNECTOR:
        switch (typeIO) {
        case NIO:
            return (T) new NioSocketChannel();
        case NATIVE:
            return (T) new EpollSocketChannel();
        default:
            throw new IllegalStateException("invalid type IO: " + typeIO);
        }
    default:
        throw new IllegalStateException("invalid kind channel: " + kindChannel);
    }
}