Examples of newSucceededFuture()


Examples of io.netty.channel.Channel.newSucceededFuture()

        Channel channel = NioOutputStreamChannel.create(process, out);
        channel.config().setAutoRead(false);
        channel.pipeline().addLast( new DataEventHandler( process, handle ));
        eventLoopGroup.register(channel);

        return channel.newSucceededFuture();
    }
}
View Full Code Here

Examples of io.netty.channel.Channel.newSucceededFuture()

            Channel channel = NioInputStreamChannel.create(process, in);
            channel.config().setAutoRead(false);
            channel.pipeline().addLast( new DataEventHandler( process, handle ) );
            eventLoopGroup.register(channel);

            return channel.newSucceededFuture();
        }

        return null;
    }
}
View Full Code Here

Examples of io.netty.channel.EventLoop.newSucceededFuture()

        final EventLoop eventLoop = ch.eventLoop();
        final DnsCacheEntry cachedResult = queryCache.get(question);
        if (cachedResult != null) {
            if (cachedResult.response != null) {
                return eventLoop.newSucceededFuture(cachedResult.response.retain());
            } else {
                return eventLoop.newFailedFuture(cachedResult.cause);
            }
        } else {
            return query0(nameServerAddresses, question, eventLoop.<DnsResponse>newPromise());
View Full Code Here

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

    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.nodyn.netty.pipe.NioDuplexStreamChannel.newSucceededFuture()

            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.newSucceededFuture()

        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.NioOutputStreamChannel.newSucceededFuture()

    protected void openOutput(int fd, FileDescriptor fileDescriptor) throws IOException {
        FileOutputStream out = new FileOutputStream(fileDescriptor);

        NioOutputStreamChannel nioChannel = NioOutputStreamChannel.create(this.process, out);
        nioChannel.config().setAutoRead(false);
        this.channelFuture = nioChannel.newSucceededFuture();
        //nioChannel.pipeline().addLast("debug", new DebugHandler("output:" + fd + " // " + process.getPosix().getpid()));
        process.getEventLoop().getEventLoopGroup().register(nioChannel);

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

Examples of io.nodyn.netty.pipe.ipc.DuplexIPCChannel.newSucceededFuture()

    protected void openDuplex(int fd, FileDescriptor fileDescriptor) throws NoSuchFieldException, IllegalAccessException, IOException {
        if (this.ipc) {
            DuplexIPCChannel channel = new DuplexIPCChannel(this, process.getPosix(), fd);
            //channel.pipeline().addLast("debug", new DebugHandler("ipc"));
            this.channelFuture = channel.newSucceededFuture();
            process.getEventLoop().getEventLoopGroup().register(channel);
        } else {
            FileInputStream in = new FileInputStream(fileDescriptor);
            FileOutputStream out = new FileOutputStream(fileDescriptor);
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.