Examples of UTF8Output


Examples of io.undertow.websockets.core.UTF8Output

            @Override
            public void run() {
                try {
                    if (singleBuffer.remaining() > 2) {
                        final int code = singleBuffer.getShort();
                        session.close(new javax.websocket.CloseReason(javax.websocket.CloseReason.CloseCodes.getCloseCode(code), new UTF8Output(singleBuffer).extract()));
                    } else {
                        session.close();
                    }
                } catch (IOException e) {
                    invokeOnError(e);
View Full Code Here

Examples of io.undertow.websockets.jsr.UTF8Output

            if (textMessage == null) {
                onError(s, JsrWebSocketMessages.MESSAGES.receivedTextFrameButNoMethod());
                return;
            }
            if (assembledTextFrame == null) {
                assembledTextFrame = new UTF8Output();
            }
            UTF8Output builder = assembledTextFrame;
            builder.write(payload);
            if (header.isLastFragement() || (textMessage.hasParameterType(boolean.class) && !textMessage.isDecoderRequired() && builder.hasData())) {
                Object messageObject;
                if (textMessage.isDecoderRequired()) {
                    try {
                        messageObject = session.getEncoding().decodeText(textMessage.getMessageType(), builder.extract());
                    } catch (DecodeException e) {
                        onError(s, e);
                        return;
                    }
                } else if (textMessage.getMessageType().equals(Reader.class)) {
                    messageObject = new StringReader(builder.extract());
                } else {
                    messageObject = builder.extract();
                }

                final Map<Class<?>, Object> params = new HashMap<Class<?>, Object>();
                params.put(Session.class, session);
                params.put(Map.class, session.getPathParameters());
View Full Code Here

Examples of io.undertow.websockets.jsr.UTF8Output

            if (textMessage == null) {
                onError(s, JsrWebSocketMessages.MESSAGES.receivedTextFrameButNoMethod());
                return;
            }
            if (assembledTextFrame == null) {
                assembledTextFrame = new UTF8Output();
            }
            UTF8Output builder = assembledTextFrame;
            builder.write(payload);
            if (header.isLastFragement() || (textMessage.hasParameterType(boolean.class) && !textMessage.isDecoderRequired() && builder.hasData())) {
                Object messageObject;
                if (textMessage.isDecoderRequired()) {
                    try {
                        messageObject = session.getEncoding().decodeText(textMessage.getMessageType(), builder.extract());
                    } catch (DecodeException e) {
                        onError(s, e);
                        return;
                    }
                } else {
                    messageObject = builder.extract();
                }

                final Map<Class<?>, Object> params = new HashMap<>();
                params.put(Session.class, session);
                params.put(Map.class, session.getPathParameters());
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.