Examples of popString()


Examples of org.zeromq.ZMsg.popString()

    {
        request.push("REQUEST");
        request.send(pipe);
        ZMsg reply = ZMsg.recvMsg(pipe);
        if (reply != null) {
            String status = reply.popString();
            if (status.equals("FAILED"))
                reply.destroy();
        }
        return reply;
    }
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

        //  Callback when we remove server from agent 'servers' hash table
        private void controlMessage()
        {
            ZMsg msg = ZMsg.recvMsg(pipe);
            String command = msg.popString();

            if (command.equals("CONNECT")) {
                String endpoint = msg.popString();
                System.out.printf("I: connecting to %s...\n", endpoint);
                router.connect(endpoint);
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

        {
            ZMsg msg = ZMsg.recvMsg(pipe);
            String command = msg.popString();

            if (command.equals("CONNECT")) {
                String endpoint = msg.popString();
                System.out.printf("I: connecting to %s...\n", endpoint);
                router.connect(endpoint);
                Server server = new Server(endpoint);
                servers.put(endpoint, server);
                actives.add(server);
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

        private void routerMessage()
        {
            ZMsg reply = ZMsg.recvMsg(router);

            //  Frame 0 is server that replied
            String endpoint = reply.popString();
            Server server = servers.get(endpoint);
            assert (server != null);
            if (!server.alive) {
                actives.add(server);
                server.alive = true;
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

            }
            server.pingAt = System.currentTimeMillis() + PING_INTERVAL;
            server.expires = System.currentTimeMillis() + SERVER_TTL;

            //  Frame 1 may be sequence number for reply
            String sequenceStr = reply.popString();
            if (Integer.parseInt(sequenceStr) == sequence) {
                reply.push("OK");
                reply.send(pipe);
                request.destroy();
                request = null;
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

            if (items[0].isReadable()) {
                //  Reply is [empty][sequence][OK]
                reply = ZMsg.recvMsg(socket);
                assert (reply.size() == 3);
                reply.pop();
                String sequenceStr = reply.popString();
                int sequenceNbr = Integer.parseInt(sequenceStr);
                if (sequenceNbr == sequence)
                    break;
                reply.destroy();
            }
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

        msg.add(key);
        msg.send(pipe);

        ZMsg reply = ZMsg.recvMsg(pipe);
        if (reply != null) {
            String value = reply.popString();
            reply.destroy();
            return value;
        }
        return null;
    }
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

        //  Here we handle the different control messages from the frontend;
        //  SUBTREE, CONNECT, SET, and GET:
        private boolean controlMessage()
        {
            ZMsg msg = ZMsg.recvMsg(pipe);
            String command = msg.popString();
            if (command == null)
                return false;      //  Interrupted

            if (command.equals("SUBTREE")) {
                subtree = msg.popString();
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

            String command = msg.popString();
            if (command == null)
                return false;      //  Interrupted

            if (command.equals("SUBTREE")) {
                subtree = msg.popString();
            }
            else
            if (command.equals("CONNECT")) {
                String address = msg.popString();
                String service = msg.popString();
View Full Code Here

Examples of org.zeromq.ZMsg.popString()

            if (command.equals("SUBTREE")) {
                subtree = msg.popString();
            }
            else
            if (command.equals("CONNECT")) {
                String address = msg.popString();
                String service = msg.popString();
                if (nbrServers < SERVER_MAX) {
                    server [nbrServers++] = new Server(
                            ctx, address, Integer.parseInt(service), subtree);
                    //  We broadcast updates to all known servers
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.