Package io.undertow.websockets.api

Examples of io.undertow.websockets.api.CloseReason


                long maxSize = maxMessageSize(session, frame.getType());

                if (maxSize > 0 && frame.getPayloadSize() > maxSize) {
                    if (executeInIoThread) {
                        session.sendClose(new CloseReason(CloseReason.MSG_TOO_BIG, null), null);
                    } else {
                        session.getFrameHandlerExecutor().execute(new Runnable() {
                            @Override
                            public void run() {
                                session.sendClose(new CloseReason(CloseReason.MSG_TOO_BIG, null), null);
                            }
                        });
                    }
                    return;
                }
View Full Code Here


                                }
                                return;
                            case CLOSE:
                                delegateListener.closeFrameReceived = true;
                                final CloseReason reason;

                                // we asume at least the status code is in the first frame which should be ok
                                if (buffers[0].hasRemaining()) {
                                    int code = buffers[0].getShort();
                                    String text;
                                    if (StreamSinkChannelUtils.payloadLength(buffers) > 0) {
                                        text = WebSocketUtils.toUtf8String(buffers);
                                    } else {
                                        text = null;
                                    }
                                    reason = new CloseReason(code, text);
                                } else {
                                    reason = null;
                                }
                                if (session.executeInIoThread) {
                                    handler.onCloseFrame(session, reason);
View Full Code Here

                        size += streamSourceFrameChannel.getPayloadSize();

                        // this also match for TEXT frames
                        if (maxSize > 0 && size > maxSize) {
                            if (executeInIoThread) {
                                session.sendClose(new CloseReason(CloseReason.MSG_TOO_BIG, null), null);
                            } else {
                                session.getFrameHandlerExecutor().execute(new Runnable() {
                                    @Override
                                    public void run() {
                                        session.sendClose(new CloseReason(CloseReason.MSG_TOO_BIG, null), null);
                                    }
                                });
                            }
                            return;
                        }
View Full Code Here

                long maxSize = maxMessageSize(session, frame.getType());

                if (maxSize > 0 && frame.getPayloadSize() > maxSize) {
                    if (executeInIoThread) {
                        session.sendClose(new CloseReason(CloseReason.MSG_TOO_BIG, null), null);
                    } else {
                        session.getFrameHandlerExecutor().execute(new Runnable() {
                            @Override
                            public void run() {
                                session.sendClose(new CloseReason(CloseReason.MSG_TOO_BIG, null), null);
                            }
                        });
                    }
                    return;
                }
View Full Code Here

                                }
                                return;
                            case CLOSE:
                                delegateListener.closeFrameReceived = true;
                                final CloseReason reason;

                                // we asume at least the status code is in the first frame which should be ok
                                if (buffers[0].hasRemaining()) {
                                    int code = buffers[0].getShort();
                                    String text;
                                    if (StreamSinkChannelUtils.payloadLength(buffers) > 0) {
                                        text = WebSocketUtils.toUtf8String(buffers);
                                    } else {
                                        text = null;
                                    }
                                    reason = new CloseReason(code, text);
                                } else {
                                    reason = null;
                                }
                                if (session.executeInIoThread) {
                                    handler.onCloseFrame(session, reason);
View Full Code Here

                        size += streamSourceFrameChannel.getPayloadSize();

                        // this also match for TEXT frames
                        if (maxSize > 0 && size > maxSize) {
                            if (executeInIoThread) {
                                session.sendClose(new CloseReason(CloseReason.MSG_TOO_BIG, null), null);
                            } else {
                                session.getFrameHandlerExecutor().execute(new Runnable() {
                                    @Override
                                    public void run() {
                                        session.sendClose(new CloseReason(CloseReason.MSG_TOO_BIG, null), null);
                                    }
                                });
                            }
                            return;
                        }
View Full Code Here

TOP

Related Classes of io.undertow.websockets.api.CloseReason

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.