Examples of pipeline()


Examples of io.netty.channel.socket.nio.NioSocketChannel.pipeline()

    public TCPWrap(NodeProcess process, int fd) throws Exception {
        super(process, false);
        SocketChannel socketChannel = UnsafeTcp.attach(fd);
        NioSocketChannel channel = new NioSocketChannel(socketChannel);
        this.channelFuture = channel.newSucceededFuture();
        channel.pipeline().addLast("emit.afterConnect", new AfterConnectEventHandler(this.process, TCPWrap.this));
        channel.pipeline().addLast("emit.eof", new EOFEventHandler(this.process, TCPWrap.this));
        channel.pipeline().addLast("handle", new UnrefHandler(this));
        process.getEventLoop().getEventLoopGroup().register(channel);
    }
View Full Code Here

Examples of io.netty.channel.socket.nio.NioSocketChannel.pipeline()

        super(process, false);
        SocketChannel socketChannel = UnsafeTcp.attach(fd);
        NioSocketChannel channel = new NioSocketChannel(socketChannel);
        this.channelFuture = channel.newSucceededFuture();
        channel.pipeline().addLast("emit.afterConnect", new AfterConnectEventHandler(this.process, TCPWrap.this));
        channel.pipeline().addLast("emit.eof", new EOFEventHandler(this.process, TCPWrap.this));
        channel.pipeline().addLast("handle", new UnrefHandler(this));
        process.getEventLoop().getEventLoopGroup().register(channel);
    }

    public TCPWrap(NodeProcess process, ChannelFuture channelFuture) {
View Full Code Here

Examples of io.netty.channel.socket.nio.NioSocketChannel.pipeline()

        SocketChannel socketChannel = UnsafeTcp.attach(fd);
        NioSocketChannel channel = new NioSocketChannel(socketChannel);
        this.channelFuture = channel.newSucceededFuture();
        channel.pipeline().addLast("emit.afterConnect", new AfterConnectEventHandler(this.process, TCPWrap.this));
        channel.pipeline().addLast("emit.eof", new EOFEventHandler(this.process, TCPWrap.this));
        channel.pipeline().addLast("handle", new UnrefHandler(this));
        process.getEventLoop().getEventLoopGroup().register(channel);
    }

    public TCPWrap(NodeProcess process, ChannelFuture channelFuture) {
        super(process, channelFuture);
View Full Code Here

Examples of io.netty.channel.socket.nio.NioSocketChannel.pipeline()

  public static void main(String[] args) throws Exception {
    final SocketChannel ch = new NioSocketChannel();
    new NioEventLoopGroup().register(ch);
    final long start = System.currentTimeMillis();
    ch.pipeline().addLast(new RedisCommandEncoder(), new RedisReplyDecoder());
    ch.connect(new InetSocketAddress("localhost", 6379)).addListener(new ChannelFutureListener() {
      @Override
      public void operationComplete(ChannelFuture channelFuture) throws Exception {
        write(ch);
      }
View Full Code Here

Examples of io.netty.channel.socket.nio.NioSocketChannel.pipeline()

  public static Promise<RedisClientBase> connect(String host, int port) {
    final Queue<Promise<Reply>> queue = new LinkedList<>();
    SocketChannel socketChannel = new NioSocketChannel();
    final RedisClientBase client = new RedisClientBase(socketChannel, queue);
    socketChannel.pipeline().addLast(new RedisCommandEncoder(), new RedisReplyDecoder(),
            new SimpleChannelInboundHandler<Reply<?>>() {
              @Override
              protected void channelRead0(ChannelHandlerContext channelHandlerContext, Reply<?> reply) throws Exception {
                Promise<Reply> poll;
                synchronized (client) {
View Full Code Here

Examples of io.nodyn.netty.pipe.NioDuplexStreamChannel.pipeline()

            NioDuplexStreamChannel nioChannel = NioDuplexStreamChannel.create(this.process, in, out);
            nioChannel.config().setAutoRead(false);
            nioChannel.config().setOption(ChannelOption.ALLOW_HALF_CLOSURE, true);

            //nioChannel.pipeline().addLast("debug", new DebugHandler("duplex:" + fd + " // " + process.getPosix().getpid()));
            nioChannel.pipeline().addLast("emit.data", new DataEventHandler(this.process, this));
            nioChannel.pipeline().addLast("emit.eof", new EOFEventHandler(this.process, this));
            this.channelFuture = nioChannel.newSucceededFuture();
            process.getEventLoop().getEventLoopGroup().register(nioChannel);
        }
View Full Code Here

Examples of io.nodyn.netty.pipe.NioDuplexStreamChannel.pipeline()

            nioChannel.config().setAutoRead(false);
            nioChannel.config().setOption(ChannelOption.ALLOW_HALF_CLOSURE, true);

            //nioChannel.pipeline().addLast("debug", new DebugHandler("duplex:" + fd + " // " + process.getPosix().getpid()));
            nioChannel.pipeline().addLast("emit.data", new DataEventHandler(this.process, this));
            nioChannel.pipeline().addLast("emit.eof", new EOFEventHandler(this.process, this));
            this.channelFuture = nioChannel.newSucceededFuture();
            process.getEventLoop().getEventLoopGroup().register(nioChannel);
        }

        this.type = Type.DUPLEX;
View Full Code Here

Examples of io.nodyn.netty.pipe.NioInputStreamChannel.pipeline()

        NioInputStreamChannel nioChannel = NioInputStreamChannel.create(this.process, in);
        nioChannel.config().setAutoRead(false);

        //nioChannel.pipeline().addLast("debug", new DebugHandler("input:" + fd + " // " + process.getPosix().getpid()));
        nioChannel.pipeline().addLast("emit.data", new DataEventHandler(this.process, this));
        nioChannel.pipeline().addLast("emit.eof", new EOFEventHandler(this.process, this));
        this.channelFuture = nioChannel.newSucceededFuture();
        process.getEventLoop().getEventLoopGroup().register(nioChannel);

        this.type = Type.INPUT;
View Full Code Here

Examples of io.nodyn.netty.pipe.NioInputStreamChannel.pipeline()

        NioInputStreamChannel nioChannel = NioInputStreamChannel.create(this.process, in);
        nioChannel.config().setAutoRead(false);

        //nioChannel.pipeline().addLast("debug", new DebugHandler("input:" + fd + " // " + process.getPosix().getpid()));
        nioChannel.pipeline().addLast("emit.data", new DataEventHandler(this.process, this));
        nioChannel.pipeline().addLast("emit.eof", new EOFEventHandler(this.process, this));
        this.channelFuture = nioChannel.newSucceededFuture();
        process.getEventLoop().getEventLoopGroup().register(nioChannel);

        this.type = Type.INPUT;
    }
View Full Code Here

Examples of net.minecraft.util.io.netty.channel.Channel.pipeline()

          @Override
          public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                Channel channel = (Channel) msg;

                // Prepare to initialize ths channel
                channel.pipeline().addFirst(beginInitProtocol);
                ctx.fireChannelRead(msg);
          }
        };
  }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.