Package org.atmosphere.wasync

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


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

        final Socket socket = client.create();
        IOException ioException = null;
        try {

            socket.on(new Function<ConnectException>() {
View Full Code Here


        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

                        // Fool the decoder mapping
                        return new StringReader(s);
                    }
                }).transport(transport());

        Socket socket = client.create();
        socket.on(Event.CLOSE, new Function<String>() {
            @Override
            public void on(String t) {
                b.get().append(t);
            }
View Full Code Here

                        // Fool the decoder mapping
                        return s;
                    }
                }).transport(transport());

        Socket socket = client.create();
        socket.on("message", new Function<String>() {
            @Override
            public void on(String t) {
                b.get().append(t);
                flatch.countDown();
View Full Code Here

                        // Fool the decoder mapping
                        return s;
                    }
                }).transport(transport());

        final Socket socket = client.create();
        socket.on("message", new Function<String>() {
            @Override
            public void on(String t) {
                //System.out.println("=>" + t);
View Full Code Here

                        return new EventPOJO(e, s);
                    }
                })
                .transport(transport());

        Socket socket = client.create();
        socket.on(new Function<POJO>() {
            @Override
            public void on(POJO t) {
                response.set(t);
                latch.countDown();
View Full Code Here

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

        Socket socket = client.create();

        socket.on("message", new Function<String>() {
            @Override
            public void on(String t) {
// the status should have been updated to something else than INIT
View Full Code Here

                .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

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

        Socket socket = client.create();

        socket.on("message", new Function<String>() {
            @Override
            public void on(String t) {
                logger.info("Function invoked {}", t);
View Full Code Here

            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

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.