Package io.netty.channel.socket

Examples of io.netty.channel.socket.SocketChannel.writeAndFlush()


            SocketChannel ch = (SocketChannel) cb.handler(h).connect().sync().channel();
            assertTrue(ch.isActive());
            assertFalse(ch.isOutputShutdown());

            s = ss.accept();
            ch.writeAndFlush(Unpooled.wrappedBuffer(new byte[] { 1 })).sync();
            assertEquals(1, s.getInputStream().read());

            assertTrue(h.ch.isOpen());
            assertTrue(h.ch.isActive());
            assertFalse(h.ch.isInputShutdown());
View Full Code Here


    public void testWriteBeforeConnect(Bootstrap cb) throws Throwable {
        TestHandler h = new TestHandler();
        SocketChannel ch = null;
        try {
            ch = (SocketChannel) cb.handler(h).connect().channel();
            ch.writeAndFlush(Unpooled.wrappedBuffer(new byte[] { 1 }));
        } finally {
            if (ch != null) {
                ch.close();
            }
        }
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.