Search in sources :

Example 1 with BootstrapFactory

use of io.netty.testsuite.transport.TestsuitePermutation.BootstrapFactory in project netty by netty.

the class SctpTestPermutation method sctpServerChannel.

static List<BootstrapFactory<ServerBootstrap>> sctpServerChannel() {
    if (!TestUtils.isSctpSupported()) {
        return Collections.emptyList();
    }
    List<BootstrapFactory<ServerBootstrap>> list = new ArrayList<BootstrapFactory<ServerBootstrap>>();
    // Make the list of ServerBootstrap factories.
    list.add(new BootstrapFactory<ServerBootstrap>() {

        @Override
        public ServerBootstrap newInstance() {
            return new ServerBootstrap().group(nioBossGroup, nioWorkerGroup).channel(NioSctpServerChannel.class);
        }
    });
    list.add(new BootstrapFactory<ServerBootstrap>() {

        @Override
        public ServerBootstrap newInstance() {
            return new ServerBootstrap().group(oioBossGroup, oioWorkerGroup).channel(OioSctpServerChannel.class);
        }
    });
    return list;
}
Also used : BootstrapFactory(io.netty.testsuite.transport.TestsuitePermutation.BootstrapFactory) ArrayList(java.util.ArrayList) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) OioSctpServerChannel(io.netty.channel.sctp.oio.OioSctpServerChannel) NioSctpServerChannel(io.netty.channel.sctp.nio.NioSctpServerChannel)

Example 2 with BootstrapFactory

use of io.netty.testsuite.transport.TestsuitePermutation.BootstrapFactory in project netty by netty.

the class EpollSocketTestPermutation method serverSocket.

@SuppressWarnings("unchecked")
@Override
public List<BootstrapFactory<ServerBootstrap>> serverSocket() {
    List<BootstrapFactory<ServerBootstrap>> toReturn = new ArrayList<BootstrapFactory<ServerBootstrap>>();
    toReturn.add(new BootstrapFactory<ServerBootstrap>() {

        @Override
        public ServerBootstrap newInstance() {
            return new ServerBootstrap().group(EPOLL_BOSS_GROUP, EPOLL_WORKER_GROUP).channel(EpollServerSocketChannel.class);
        }
    });
    if (isServerFastOpen()) {
        toReturn.add(new BootstrapFactory<ServerBootstrap>() {

            @Override
            public ServerBootstrap newInstance() {
                ServerBootstrap serverBootstrap = new ServerBootstrap().group(EPOLL_BOSS_GROUP, EPOLL_WORKER_GROUP).channel(EpollServerSocketChannel.class);
                serverBootstrap.option(EpollChannelOption.TCP_FASTOPEN, 5);
                return serverBootstrap;
            }
        });
    }
    toReturn.add(new BootstrapFactory<ServerBootstrap>() {

        @Override
        public ServerBootstrap newInstance() {
            return new ServerBootstrap().group(nioBossGroup, nioWorkerGroup).channel(NioServerSocketChannel.class);
        }
    });
    return toReturn;
}
Also used : BootstrapFactory(io.netty.testsuite.transport.TestsuitePermutation.BootstrapFactory) NioServerSocketChannel(io.netty.channel.socket.nio.NioServerSocketChannel) ArrayList(java.util.ArrayList) ServerBootstrap(io.netty.bootstrap.ServerBootstrap)

Example 3 with BootstrapFactory

use of io.netty.testsuite.transport.TestsuitePermutation.BootstrapFactory in project netty by netty.

the class SctpTestPermutation method sctpClientChannel.

static List<BootstrapFactory<Bootstrap>> sctpClientChannel() {
    if (!TestUtils.isSctpSupported()) {
        return Collections.emptyList();
    }
    List<BootstrapFactory<Bootstrap>> list = new ArrayList<BootstrapFactory<Bootstrap>>();
    list.add(new BootstrapFactory<Bootstrap>() {

        @Override
        public Bootstrap newInstance() {
            return new Bootstrap().group(nioWorkerGroup).channel(NioSctpChannel.class);
        }
    });
    list.add(new BootstrapFactory<Bootstrap>() {

        @Override
        public Bootstrap newInstance() {
            return new Bootstrap().group(oioWorkerGroup).channel(OioSctpChannel.class);
        }
    });
    return list;
}
Also used : BootstrapFactory(io.netty.testsuite.transport.TestsuitePermutation.BootstrapFactory) ArrayList(java.util.ArrayList) Bootstrap(io.netty.bootstrap.Bootstrap) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) NioSctpChannel(io.netty.channel.sctp.nio.NioSctpChannel) OioSctpChannel(io.netty.channel.sctp.oio.OioSctpChannel)

Aggregations

ServerBootstrap (io.netty.bootstrap.ServerBootstrap)3 BootstrapFactory (io.netty.testsuite.transport.TestsuitePermutation.BootstrapFactory)3 ArrayList (java.util.ArrayList)3 Bootstrap (io.netty.bootstrap.Bootstrap)1 NioSctpChannel (io.netty.channel.sctp.nio.NioSctpChannel)1 NioSctpServerChannel (io.netty.channel.sctp.nio.NioSctpServerChannel)1 OioSctpChannel (io.netty.channel.sctp.oio.OioSctpChannel)1 OioSctpServerChannel (io.netty.channel.sctp.oio.OioSctpServerChannel)1 NioServerSocketChannel (io.netty.channel.socket.nio.NioServerSocketChannel)1