Examples of newOptionsBuilder()


Examples of org.atmosphere.wasync.Client.newOptionsBuilder()

        RequestBuilder request = client.newRequestBuilder()
                .method(Request.METHOD.GET)
                .uri(targetUrl + "/suspend")
                .transport(transport());

        Socket socket = client.create(client.newOptionsBuilder().reconnect(false).build());
        socket.on(Event.MESSAGE, new Function<String>() {
            @Override
            public void on(String t) {
                logger.info("Function invoked {}", t);
                response.set(t);
View Full Code Here

Examples of org.atmosphere.wasync.Client.newOptionsBuilder()

        final CountDownLatch latch = new CountDownLatch(1);
        final AtomicReference<Class<? extends TimeoutException>> response = new AtomicReference<Class<? extends TimeoutException>>();
        Client client = ClientFactory.getDefault().newClient();

        Options o = client.newOptionsBuilder().reconnect(false).requestTimeoutInSeconds(5).build();
        RequestBuilder request = client.newRequestBuilder()
                .method(Request.METHOD.GET)
                .uri(targetUrl + "/suspend")
                .encoder(new Encoder<String, String>() {
                    @Override
View Full Code Here

Examples of org.atmosphere.wasync.Client.newOptionsBuilder()

            public String decode(Event evntp, String s) {
                return s;
            }
        });
        for (int i = 0; i < getCount(); i++) {
            sockets[i] = client.create(client.newOptionsBuilder().runtime(c, true).build());
            sockets[i].on(new Function<Integer>() {
                @Override
                public void on(Integer statusCode) {
                }
            });
View Full Code Here

Examples of org.atmosphere.wasync.Client.newOptionsBuilder()

        RequestBuilder request = client.newRequestBuilder()
                .method(Request.METHOD.GET)
                .uri(targetUrl + "/suspend")
                .transport(transport());

        Socket socket = client.create(client.newOptionsBuilder().reconnect(false).build());
        socket.on(Event.CLOSE, new Function<String>() {
            @Override
            public void on(String t) {
                //Can I receive close message when server is stopped?
                logger.info("Function invoked {}", t);
View Full Code Here

Examples of org.atmosphere.wasync.Client.newOptionsBuilder()

                .method(Request.METHOD.GET)
                .header("X-Test", "foo")
                .uri(targetUrl + "/suspend")
                .transport(transport());

        Socket socket = client.create(client.newOptionsBuilder().reconnect(false).build());
        socket.on(Event.CLOSE.name(), new Function<String>() {

            @Override
            public void on(String t) {
                latch.countDown();
View Full Code Here

Examples of org.atmosphere.wasync.Client.newOptionsBuilder()

            final AtomicLong total = new AtomicLong(0);

            Socket[] sockets = new Socket[clientNum];
            for (int i = 0; i < clientCount; i++) {
                final AtomicLong start = new AtomicLong(0);
                sockets[i] = client.create(client.newOptionsBuilder().runtime(c).reconnect(false).build())
                        .on(new Function<Integer>() {
                            @Override
                            public void on(Integer statusCode) {
                                start.set(System.currentTimeMillis());
                                l.countDown();
View Full Code Here

Examples of org.atmosphere.wasync.Client.newOptionsBuilder()

            l.await(30, TimeUnit.SECONDS);

            System.out.println("OK, all Connected: " + clientNum);

            Socket socket = client.create(client.newOptionsBuilder().runtime(c).build());
            socket.open(request.build());
            for (int i = 0; i < messageNum; i++) {
                socket.fire("message" + i);
            }
            messages.await(1, TimeUnit.HOURS);
View Full Code Here

Examples of org.atmosphere.wasync.impl.AtmosphereClient.newOptionsBuilder()

        RequestBuilder request = client.newRequestBuilder()
                .method(Request.METHOD.GET)
                .uri(targetUrl + "/suspend")
                .transport(Request.TRANSPORT.WEBSOCKET);

        Socket socket = client.create(client.newOptionsBuilder().runtime(ahc, false).build());
        socket.open(request.build());
        socket.close();

        // AHC is async closed
        Thread.sleep(1000);
View Full Code Here

Examples of org.atmosphere.wasync.impl.AtmosphereClient.newOptionsBuilder()

                .method(Request.METHOD.GET)
                .uri(targetUrl + "/suspend")
                .header("Content-Type", "application/octet-stream")
                .transport(Request.TRANSPORT.LONG_POLLING);

        final Socket socket = client.create(client.newOptionsBuilder().build());

        final CountDownLatch suspendedLatch = new CountDownLatch(1);

        socket.on(new Function<Integer>() {
            @Override
View Full Code Here

Examples of org.atmosphere.wasync.impl.AtmosphereClient.newOptionsBuilder()

        RequestBuilder request = client.newRequestBuilder()
                .method(Request.METHOD.GET)
                .uri(targetUrl + "/suspend")
                .transport(Request.TRANSPORT.LONG_POLLING);

        final Socket socket = client.create(client.newOptionsBuilder().build());

        final CountDownLatch suspendedLatch = new CountDownLatch(1);

        socket.on(new Function<Integer>() {
            @Override
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.