Examples of invokeWebSocketProtocol()


Examples of org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol()

            }
        }));

        AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("yoComet").pathInfo("/a").build();
        processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w));
        processor.invokeWebSocketProtocol(w, "yoWebSocket");
        framework.getBroadcasterFactory().lookup("/*").broadcast("yoBroadcast").get();

        assertEquals(b.toString(), "yoCometyoWebSocketyoBroadcast");

    }
View Full Code Here

Examples of org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol()

                .getWebSocketProcessor(framework);
        registerWebSocketHandler("/*", new EchoHandler());

        AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("yoComet").pathInfo("/a").build();
        processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w));
        processor.invokeWebSocketProtocol(w, "yoWebSocket");

        assertEquals(b.toString(), "yoWebSocket");
    }

    private void registerWebSocketHandler(String path, WebSocketStreamingHandler w) {
View Full Code Here

Examples of org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol()

        registerWebSocketHandler("/a", new EchoHandler());
        registerWebSocketHandler("/b", new EchoHandler());

        AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("a").pathInfo("/a").build();
        processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w));
        processor.invokeWebSocketProtocol(w, "a");

        assertEquals(b.toString(), "a");

        request = new AtmosphereRequest.Builder().destroyable(false).body("b").pathInfo("/b").build();
        processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w));
View Full Code Here

Examples of org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol()

        assertEquals(b.toString(), "a");

        request = new AtmosphereRequest.Builder().destroyable(false).body("b").pathInfo("/b").build();
        processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w));
        processor.invokeWebSocketProtocol(w, "b");

        // The WebSocketHandler is shared.
        assertEquals(b.toString(), "ab");
    }
View Full Code Here

Examples of org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol()

            }
        });

        AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("a").pathInfo("/a").build();
        processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w));
        processor.invokeWebSocketProtocol(w, "a");

        assertEquals(b.toString(), "a");
        ByteArrayOutputStream b2 = new ByteArrayOutputStream();
        final WebSocket w2 = new ArrayBaseWebSocket(b2);
        request = new AtmosphereRequest.Builder().destroyable(false).body("b").pathInfo("/b").build();
View Full Code Here

Examples of org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol()

        assertEquals(b.toString(), "a");
        ByteArrayOutputStream b2 = new ByteArrayOutputStream();
        final WebSocket w2 = new ArrayBaseWebSocket(b2);
        request = new AtmosphereRequest.Builder().destroyable(false).body("b").pathInfo("/b").build();
        processor.open(w2, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w));
        processor.invokeWebSocketProtocol(w2, "b");

        // The WebSocketHandler is shared.
        assertEquals(b2.toString(), "2b");
    }
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.