Examples of CloseMessage


Examples of com.sun.jini.test.spec.jeri.mux.util.CloseMessage

        //Send an Close message
        int sessionId = dm.getsessionId();
        DataMessage eof = new DataMessage().setEof()
            .setSessionID((byte)sessionId);
        eof.send(os);
        CloseMessage cm = new CloseMessage();
        cm.send(os);
        if (!abortReceived(is)) {
            throw new TestException("The client did not"
                + " send an Abort message");
        }
    }
View Full Code Here

Examples of com.wordnik.swaggersocket.protocol.CloseMessage

                    if (!delegateHandshake) {
                        return Action.CANCELLED;
                    }
                } else if (message.startsWith("{\"close\"")) {
                    CloseMessage c = mapper.readValue(data, CloseMessage.class);

                    logger.debug("Client disconnected {} with reason {}", c.getClose().getIdentity(), c.getClose().getReason());
                    try {
                        request.getSession().invalidate();
                    } catch (Exception ex) {
                        logger.warn("", ex);
                    }
View Full Code Here

Examples of io.undertow.websockets.core.CloseMessage

                        //if we have already recieved a close frame then the close frame handler
                        //will deal with sending back the reason message
                        if (closeReason == null) {
                            webSocketChannel.sendClose();
                        } else {
                            WebSockets.sendClose(new CloseMessage(closeReason.getCloseCode().getCode(), closeReason.getReasonPhrase()).toByteBuffer(), webSocketChannel, null);
                        }
                    }
                } finally {
                    try {
                        if (closeReason == null) {
View Full Code Here

Examples of io.undertow.websockets.core.CloseMessage

                    //if we have already recieved a close frame then the close frame handler
                    //will deal with sending back the reason message
                    if (closeReason == null) {
                        webSocketChannel.sendClose();
                    } else {
                        WebSockets.sendClose(new CloseMessage(closeReason.getCloseCode().getCode(), closeReason.getReasonPhrase()).toByteBuffer(), webSocketChannel, null);
                    }
                }
            } finally {
                close0();
            }
View Full Code Here

Examples of io.undertow.websockets.core.CloseMessage

        @Override
        protected void onFullCloseMessage(final WebSocketChannel channel, BufferedBinaryMessage message) throws IOException {
            Pooled<ByteBuffer[]> data = message.getData();
            final ByteBuffer buffer = WebSockets.mergeBuffers(data.getResource());
            final CloseMessage cm = new CloseMessage(buffer);
            data.free();
            try {
                if (webSocketClose != null) {
                    try {
                        final Map<Class<?>, Object> params = new HashMap<>();
                        params.put(Session.class, session);
                        params.put(Map.class, session.getPathParameters());
                        params.put(CloseReason.class, new CloseReason(CloseReason.CloseCodes.getCloseCode(cm.getCode()), cm.getReason()));
                        invokeMethod(params, webSocketClose, session);
                    } catch (Exception e) {
                        AnnotatedEndpoint.this.onError(session, e);
                    }
                }
View Full Code Here

Examples of io.undertow.websockets.core.CloseMessage

                    //if we have already recieved a close frame then the close frame handler
                    //will deal with sending back the reason message
                    if (closeReason == null) {
                        webSocketChannel.sendClose();
                    } else {
                        WebSockets.sendClose(new CloseMessage(closeReason.getCloseCode().getCode(), closeReason.getReasonPhrase()).toByteBuffer(), webSocketChannel, null);
                    }
                }
            } finally {
                close0();
            }
View Full Code Here

Examples of io.undertow.websockets.core.CloseMessage

                    //if we have already recieved a close frame then the close frame handler
                    //will deal with sending back the reason message
                    if (closeReason == null) {
                        webSocketChannel.sendClose();
                    } else {
                        WebSockets.sendClose(new CloseMessage(closeReason.getCloseCode().getCode(), closeReason.getReasonPhrase()).toByteBuffer(), webSocketChannel, null);
                    }
                }
            } finally {
                close0();
            }
View Full Code Here

Examples of io.undertow.websockets.core.CloseMessage

        @Override
        protected void onFullCloseMessage(final WebSocketChannel channel, BufferedBinaryMessage message) throws IOException {
            Pooled<ByteBuffer[]> data = message.getData();
            final ByteBuffer buffer = WebSockets.mergeBuffers(data.getResource());
            final CloseMessage cm = new CloseMessage(buffer);
            data.free();
            try {
                if (webSocketClose != null) {
                    try {
                        final Map<Class<?>, Object> params = new HashMap<Class<?>, Object>();
                        params.put(Session.class, session);
                        params.put(Map.class, session.getPathParameters());
                        params.put(CloseReason.class, new CloseReason(CloseReason.CloseCodes.getCloseCode(cm.getReason()), cm.getString()));
                        invokeMethod(params, webSocketClose, session);
                    } catch (Exception e) {
                        AnnotatedEndpoint.this.onError(session, e);
                    }
                }
View Full Code Here

Examples of io.undertow.websockets.core.CloseMessage

                        //if we have already recieved a close frame then the close frame handler
                        //will deal with sending back the reason message
                        if (closeReason == null || closeReason.getCloseCode().getCode() == CloseReason.CloseCodes.NO_STATUS_CODE.getCode()) {
                            webSocketChannel.sendClose();
                        } else {
                            WebSockets.sendClose(new CloseMessage(closeReason.getCloseCode().getCode(), closeReason.getReasonPhrase()).toByteBuffer(), webSocketChannel, null);
                        }
                    }
                } finally {
                    try {
                        String reason = null;
View Full Code Here

Examples of io.undertow.websockets.core.CloseMessage

                    //if we have already recieved a close frame then the close frame handler
                    //will deal with sending back the reason message
                    if (closeReason == null) {
                        webSocketChannel.sendClose();
                    } else {
                        WebSockets.sendClose(new CloseMessage(closeReason.getCloseCode().getCode(), closeReason.getReasonPhrase()).toByteBuffer(), webSocketChannel, null);
                    }
                }
            } finally {
                close0();
            }
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.