Package org.jboss.aerogear.io.netty.handler.codec.sockjs.protocol

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.protocol.HeartbeatFrame


                public void run() {
                    if (ctx.channel().isActive() && ctx.channel().isRegistered()) {
                        if (logger.isDebugEnabled()) {
                            logger.debug("Sending heartbeat for {}", session);
                        }
                        ctx.channel().writeAndFlush(new HeartbeatFrame());
                    }
                }
            }, interval, interval, TimeUnit.MILLISECONDS);
        }
    }
View Full Code Here


            public void run() {
                if (ctx.channel().isActive() && ctx.channel().isRegistered()) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Sending heartbeat for {}", session);
                    }
                    ctx.channel().writeAndFlush(new HeartbeatFrame());
                }
            }
        },
        session.config().heartbeatInterval(),
        session.config().heartbeatInterval(),
View Full Code Here

        assertThat(response.content().toString(CharsetUtil.UTF_8), equalTo("callback(\"c[2000,\\\"Oh no\\\"]\");\r\n"));
    }

    @Test
    public void flushHeartbeatFrame() {
        final FullHttpResponse response = writeFrame(new HeartbeatFrame());
        assertThat(response.getStatus(), equalTo(HttpResponseStatus.OK));
        SockJsTestUtil.verifyNoCacheHeaders(response);
        assertThat(response.content().toString(CharsetUtil.UTF_8), equalTo("callback(\"h\");\r\n"));
    }
View Full Code Here

        assertThat(response.content().toString(CharsetUtil.UTF_8), equalTo("callback(\"h\");\r\n"));
    }

    @Test
    public void flushNoCallbackSet() {
        final FullHttpResponse response = writeFrame(new HeartbeatFrame(), false);
        assertThat(response.getStatus(), equalTo(HttpResponseStatus.INTERNAL_SERVER_ERROR));
        assertThat(response.content().toString(CharsetUtil.UTF_8), equalTo("\"callback\" parameter required"));
    }
View Full Code Here

    @Test
    public void copy() {
        assertCopy(new MessageFrame("testing copy"));
        assertCopy(new CloseFrame(100, "msg"));
        assertCopy(new HeartbeatFrame());
        assertCopy(new OpenFrame());
        assertCopy(new PreludeFrame());
    }
View Full Code Here

    @Test
    public void duplicate() {
        assertDuplicate(new MessageFrame("testing duplicate"));
        assertDuplicate(new CloseFrame(101, "msg"));
        assertDuplicate(new HeartbeatFrame());
        assertDuplicate(new OpenFrame());
        assertDuplicate(new PreludeFrame());
    }
View Full Code Here

    @Test
    public void retain() {
        assertRetain(new MessageFrame("testing retain"));
        assertRetain(new CloseFrame(102, "msg"));
        assertRetainImmutable(new HeartbeatFrame());
        assertRetainImmutable(new OpenFrame());
        assertRetainImmutable(new PreludeFrame());
    }
View Full Code Here

                public void run() {
                    if (ctx.channel().isActive() && ctx.channel().isRegistered()) {
                        if (logger.isDebugEnabled()) {
                            logger.debug("Sending heartbeat for {}", session);
                        }
                        ctx.channel().writeAndFlush(new HeartbeatFrame());
                    }
                }
            }, interval, interval, TimeUnit.MILLISECONDS);
        }
    }
View Full Code Here

            public void run() {
                if (ctx.channel().isActive() && ctx.channel().isRegistered()) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Sending heartbeat for {}", session);
                    }
                    ctx.channel().writeAndFlush(new HeartbeatFrame());
                }
            }
        },
        session.config().heartbeatInterval(),
        session.config().heartbeatInterval(),
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.io.netty.handler.codec.sockjs.protocol.HeartbeatFrame

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.