Search in sources :

Example 1 with SocketChannel

use of org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel in project incubator-ratis by apache.

the class NettyServerStreamRpc method getInitializer.

private ChannelInitializer<SocketChannel> getInitializer() {
    return new ChannelInitializer<SocketChannel>() {

        @Override
        public void initChannel(SocketChannel ch) {
            ChannelPipeline p = ch.pipeline();
            p.addLast(newDecoder());
            p.addLast(newEncoder());
            p.addLast(newChannelInboundHandlerAdapter());
        }
    };
}
Also used : NioServerSocketChannel(org.apache.ratis.thirdparty.io.netty.channel.socket.nio.NioServerSocketChannel) SocketChannel(org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel) EpollServerSocketChannel(org.apache.ratis.thirdparty.io.netty.channel.epoll.EpollServerSocketChannel) ChannelInitializer(org.apache.ratis.thirdparty.io.netty.channel.ChannelInitializer) ChannelPipeline(org.apache.ratis.thirdparty.io.netty.channel.ChannelPipeline)

Example 2 with SocketChannel

use of org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel in project incubator-ratis by apache.

the class NettyServer method getInitializer.

private ChannelInitializer<SocketChannel> getInitializer() {
    return new ChannelInitializer<SocketChannel>() {

        @Override
        public void initChannel(SocketChannel ch) throws Exception {
            ChannelPipeline p = ch.pipeline();
            p.addLast(new RequestDecoderComposite());
            p.addLast(new ResponseEncoder());
            p.addLast(getServerHandler());
        }
    };
}
Also used : SocketChannel(org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel) NioServerSocketChannel(org.apache.ratis.thirdparty.io.netty.channel.socket.nio.NioServerSocketChannel) RequestDecoderComposite(org.apache.ratis.experiments.nettyzerocopy.decoders.RequestDecoderComposite) ResponseEncoder(org.apache.ratis.experiments.nettyzerocopy.encoders.ResponseEncoder)

Example 3 with SocketChannel

use of org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel in project incubator-ratis by apache.

the class NettyClient method getInitializer.

private ChannelInitializer<SocketChannel> getInitializer() {
    return new ChannelInitializer<SocketChannel>() {

        @Override
        public void initChannel(SocketChannel ch) throws Exception {
            ChannelPipeline p = ch.pipeline();
            p.addLast(new RequestEncoder());
            p.addLast(new ResponseDecoder());
            p.addLast(getClientHandler());
        }
    };
}
Also used : NioSocketChannel(org.apache.ratis.thirdparty.io.netty.channel.socket.nio.NioSocketChannel) SocketChannel(org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel) ResponseDecoder(org.apache.ratis.experiments.nettyzerocopy.decoders.ResponseDecoder) RequestEncoder(org.apache.ratis.experiments.nettyzerocopy.encoders.RequestEncoder)

Aggregations

SocketChannel (org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel)3 NioServerSocketChannel (org.apache.ratis.thirdparty.io.netty.channel.socket.nio.NioServerSocketChannel)2 RequestDecoderComposite (org.apache.ratis.experiments.nettyzerocopy.decoders.RequestDecoderComposite)1 ResponseDecoder (org.apache.ratis.experiments.nettyzerocopy.decoders.ResponseDecoder)1 RequestEncoder (org.apache.ratis.experiments.nettyzerocopy.encoders.RequestEncoder)1 ResponseEncoder (org.apache.ratis.experiments.nettyzerocopy.encoders.ResponseEncoder)1 ChannelInitializer (org.apache.ratis.thirdparty.io.netty.channel.ChannelInitializer)1 ChannelPipeline (org.apache.ratis.thirdparty.io.netty.channel.ChannelPipeline)1 EpollServerSocketChannel (org.apache.ratis.thirdparty.io.netty.channel.epoll.EpollServerSocketChannel)1 NioSocketChannel (org.apache.ratis.thirdparty.io.netty.channel.socket.nio.NioSocketChannel)1