Package io.undertow.websockets.core

Examples of io.undertow.websockets.core.StreamSinkFrameChannel


            WebSocketMessages.MESSAGES.closeFrameSentBefore();
        }
        if (channel == null) {
            channel = session.getChannel().sendFragmentedBinary();
        }
        StreamSinkFrameChannel sink = channel.send(payloadSize, finalFragment);
        return sink;
    }
View Full Code Here


            WebSocketMessages.MESSAGES.closeFrameSentBefore();
        }
        if (channel == null) {
            channel = session.getChannel().sendFragmentedText();
        }
        StreamSinkFrameChannel sink = channel.send(payloadSize, finalFragment);
        return sink;
    }
View Full Code Here

        @Override
        public void handleEvent(final WebSocketChannel channel) {
            try {
                final StreamSourceFrameChannel ws = channel.receive();
                if (ws != null) {
                    StreamSinkFrameChannel target;
                    if (ws.getType() == WebSocketFrameType.PING ||
                            ws.getType() == WebSocketFrameType.CLOSE) {
                        target = channel.send(ws.getType() == WebSocketFrameType.PING ? WebSocketFrameType.PONG : WebSocketFrameType.CLOSE);
                    } else if (ws.getType() == WebSocketFrameType.PONG) {
                        ws.getReadSetter().set(ChannelListeners.drainListener(Long.MAX_VALUE, null, null));
View Full Code Here

        @Override
        public void handleEvent(final WebSocketChannel channel) {
            try {
                final StreamSourceFrameChannel ws = channel.receive();
                if (ws != null) {
                    StreamSinkFrameChannel target;
                    if (ws.getType() == WebSocketFrameType.PING ||
                            ws.getType() == WebSocketFrameType.CLOSE) {
                        target = channel.send(ws.getType() == WebSocketFrameType.PING ? WebSocketFrameType.PONG : WebSocketFrameType.CLOSE);
                    } else if (ws.getType() == WebSocketFrameType.PONG) {
                        ws.getReadSetter().set(ChannelListeners.drainListener(Long.MAX_VALUE, null, null));
View Full Code Here

        for (int i = 0; i < LONG_MSG; i++) {
            longMsg.append(new Integer(i).toString().charAt(0));
        }

        StreamSinkFrameChannel sendChannel = clientChannel.send(WebSocketFrameType.TEXT, LONG_MSG);
        new StringWriteChannelListener(longMsg.toString()).setup(sendChannel);

        latch.await(10, TimeUnit.SECONDS);
        Assert.assertEquals(longMsg.toString(), result.get());
        clientChannel.sendClose();
View Full Code Here

        for (int i = 0; i < LONG_MSG; i++) {
            longMsg.append(new Integer(i).toString().charAt(0));
        }

        StreamSinkFrameChannel sendChannel = clientChannel.send(WebSocketFrameType.TEXT, LONG_MSG);
        new StringWriteChannelListener(longMsg.toString()).setup(sendChannel);

        latch.await(10, TimeUnit.SECONDS);

        Assert.assertEquals(longMsg.toString(), result.get());
View Full Code Here

            }

        });
        clientChannel.resumeReceives();

        StreamSinkFrameChannel sendChannel = clientChannel.send(WebSocketFrameType.TEXT, "Hello, World!".length());
        new StringWriteChannelListener("Hello, World!").setup(sendChannel);

        latch.await(10, TimeUnit.SECONDS);
        Assert.assertEquals("Hello, World!", result.get());
        clientChannel.sendClose();
View Full Code Here

            }
        });
        webSocketChannel.resumeReceives();


        StreamSinkFrameChannel sendChannel = webSocketChannel.send(WebSocketFrameType.TEXT, 11);
        new StringWriteChannelListener("Hello World").setup(sendChannel);

        latch.await(10, TimeUnit.SECONDS);
        Assert.assertEquals("Hello World", result.get());
        webSocketChannel.sendClose();
View Full Code Here

            WebSocketMessages.MESSAGES.closeFrameSentBefore();
        }
        if (channel == null) {
            channel = session.getChannel().sendFragmentedText();
        }
        StreamSinkFrameChannel sink = channel.send(payloadSize, finalFragment);
        return sink;
    }
View Full Code Here

            WebSocketMessages.MESSAGES.closeFrameSentBefore();
        }
        if (channel == null) {
            channel = session.getChannel().sendFragmentedBinary();
        }
        StreamSinkFrameChannel sink = channel.send(payloadSize, finalFragment);
        return sink;
    }
View Full Code Here

TOP

Related Classes of io.undertow.websockets.core.StreamSinkFrameChannel

Copyright © 2018 www.massapicom. 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.