Package io.netty.channel

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


        Channel sc = sb.localAddress(0).bind().sync().channel();
        int port = ((InetSocketAddress) sc.localAddress()).getPort();

        Channel cc = cb.remoteAddress(NetUtil.LOCALHOST, port).connect().sync().channel();
        cc.writeAndFlush(frames);

        while (ch.counter < frames.writerIndex() - ignoredBytes) {
            if (sh.exception.get() != null) {
                break;
            }
View Full Code Here


        });

        Channel sc = sb.bind().sync().channel();
        Channel cc = cb.connect().sync().channel();
        for (String element : data) {
            cc.writeAndFlush(element);
        }

        while (ch.counter < data.length) {
            if (sh.exception.get() != null) {
                break;
View Full Code Here

        TestHandler ch = new TestHandler();
        cb.handler(ch);
        Channel sc = sb.bind().sync().channel();
        Channel cc = cb.connect().sync().channel();
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
View Full Code Here

        cb.handler(ch);
        Channel sc = sb.bind().sync().channel();
        Channel cc = cb.connect().sync().channel();
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);

        cc.close().sync();
View Full Code Here

        Channel sc = sb.bind().sync().channel();
        Channel cc = cb.connect().sync().channel();

        for (int i = 0; i < data.length;) {
            int length = Math.min(random.nextInt(1024 * 64), data.length - i);
            cc.writeAndFlush(Unpooled.wrappedBuffer(data, i, length));
            i += length;
        }

        while (ch.counter < data.length) {
            if (sh.exception.get() != null) {
View Full Code Here

        Channel cc = cb.connect().sync().channel();
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);

        cc.close().sync();
        sc.close().sync();
View Full Code Here

        TestHandler ch = new TestHandler();
        cb.handler(ch);
        Channel sc = sb.bind().sync().channel();
        Channel cc = cb.connect().sync().channel();
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
View Full Code Here

        cb.handler(ch);
        Channel sc = sb.bind().sync().channel();
        Channel cc = cb.connect().sync().channel();
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        sh.await();
        cc.close().sync();
View Full Code Here

        Channel cc = cb.connect().sync().channel();
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        cc.writeAndFlush(Unpooled.wrappedBuffer(data)).sync();
        Thread.sleep(500);
        sh.await();
        cc.close().sync();
        sc.close().sync();
View Full Code Here

        Channel sc = sb.bind().sync().channel();
        Channel cc = cb.connect().sync().channel();
        for (int i = 0; i < data.length;) {
            int length = Math.min(random.nextInt(1024 * 3), data.length - i);
            cc.writeAndFlush(Unpooled.wrappedBuffer(data, i, length));
            i += length;
        }

        while (ch.counter < data.length) {
            if (sh.exception.get() != null) {
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.