Package org.zeromq

Examples of org.zeromq.ZMsg.pop()


                break;          //  Interrupted

            //  Frame 0: identity of client
            //  Frame 1: PING, or client control frame
            //  Frame 2: request body
            ZFrame identity = request.pop();
            ZFrame control = request.pop();
            ZMsg reply = new ZMsg();
            if (control.equals("PING"))
                reply.add("PONG");
            else {
View Full Code Here


            //  Frame 0: identity of client
            //  Frame 1: PING, or client control frame
            //  Frame 2: request body
            ZFrame identity = request.pop();
            ZFrame control = request.pop();
            ZMsg reply = new ZMsg();
            if (control.equals("PING"))
                reply.add("PONG");
            else {
                reply.add(control);
View Full Code Here

    static ZMsg
    serviceCall (mdcliapi session, String service, ZMsg request)
    {
        ZMsg reply = session.send(service, request);
        if (reply != null) {
            ZFrame status = reply.pop();
            if (status.streq("200")) {
                status.destroy();
                return reply;
            }
            else if (status.streq("400")) {
View Full Code Here

        ZMsg reply = serviceCall(
                session, "titanic.request", request);

        ZFrame uuid = null;
        if (reply != null) {
            uuid = reply.pop();
            reply.destroy();
            uuid.print("I: request UUID ");
        }
        //  2. Wait until we get a reply
        while (!Thread.currentThread().isInterrupted()) {
View Full Code Here

            worker.connect("inproc://backend");

            while (!Thread.currentThread().isInterrupted()) {
                //  The DEALER socket gives us the address envelope and message
                ZMsg msg = ZMsg.recvMsg(worker);
                ZFrame address = msg.pop();
                ZFrame content = msg.pop();
                assert (content != null);
                msg.destroy();

                //  Send 0..4 replies back
View Full Code Here

            while (!Thread.currentThread().isInterrupted()) {
                //  The DEALER socket gives us the address envelope and message
                ZMsg msg = ZMsg.recvMsg(worker);
                ZFrame address = msg.pop();
                ZFrame content = msg.pop();
                assert (content != null);
                msg.destroy();

                //  Send 0..4 replies back
                int replies = rand.nextInt(5);
View Full Code Here

                    msg.dump(log.out());
                }
                // Don't try to handle errors, just assert noisily
                assert (msg.size() >= 3);

                ZFrame header = msg.pop();
                assert (MDP.C_CLIENT.equals(header.toString()));
                header.destroy();

                ZFrame replyService = msg.pop();
                assert (service.equals(replyService.toString()));
View Full Code Here

                ZFrame header = msg.pop();
                assert (MDP.C_CLIENT.equals(header.toString()));
                header.destroy();

                ZFrame replyService = msg.pop();
                assert (service.equals(replyService.toString()));
                replyService.destroy();

                reply = msg;
                break;
View Full Code Here

                }
                liveness = HEARTBEAT_LIVENESS;
                // Don't try to handle errors, just assert noisily
                assert (msg != null && msg.size() >= 3);

                ZFrame empty = msg.pop();
                assert (empty.getData().length == 0);
                empty.destroy();

                ZFrame header = msg.pop();
                assert (MDP.W_WORKER.frameEquals(header));
View Full Code Here

                ZFrame empty = msg.pop();
                assert (empty.getData().length == 0);
                empty.destroy();

                ZFrame header = msg.pop();
                assert (MDP.W_WORKER.frameEquals(header));
                header.destroy();

                ZFrame command = msg.pop();
                if (MDP.W_REQUEST.frameEquals(command)) {
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.