Package org.zeromq

Examples of org.zeromq.ZMsg.destroy()


        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


                msg = null;
                //  Request expires after global timeout
                expires = System.currentTimeMillis() + GLOBAL_TIMEOUT;
            }
            if (msg != null)
                msg.destroy();
        }

        //  .split router messages
        //  This method processes one message from a connected
        //  server:
View Full Code Here

                reply.send(pipe);
                request.destroy();
                request = null;
            }
            else
                reply.destroy();

        }

    }
    //  .split backend agent implementation
View Full Code Here

                reply.pop();
                String sequenceStr = reply.popString();
                int sequenceNbr = Integer.parseInt(sequenceStr);
                if (sequenceNbr == sequence)
                    break;
                reply.destroy();
            }
        }
        request.destroy();
        return reply;
View Full Code Here

            ZMsg reply = client.request(request);
            if (reply == null) {
                System.out.printf("E: name service not available, aborting\n");
                break;
            }
            reply.destroy();
        }
        System.out.printf ("Average round trip cost: %d usec\n",
                (int) (System.currentTimeMillis() - start) / 10);

        client.destroy();
View Full Code Here

                capacity++;

                //  If it's READY, don't route the message any further
                ZFrame frame = msg.getFirst();
                if (new String(frame.getData()).equals(WORKER_READY)) {
                    msg.destroy();
                    msg = null;
                }
            }
            //  Or handle reply from peer broker
            else if (backends[1].isReadable()) {
View Full Code Here

                System.out.printf ("W: no response from %s\n", endpoint);
            }
        }
        if (reply != null) {
            System.out.printf ("Service is running OK\n");
            reply.destroy();
        }
        request.destroy();;
        ctx.destroy();
    }
View Full Code Here

        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

                if (value != null)
                    pipe.send(value);
                else
                    pipe.send("");
            }
            msg.destroy();

            return true;
        }
    }
View Full Code Here

        for (count = 0; count < 100000; count++) {
            ZMsg request = new ZMsg();
            request.addString("Hello world");
            ZMsg reply = clientSession.send("echo", request);
            if (reply != null)
                reply.destroy();
            else
                break; // Interrupt or failure
        }

        System.out.printf("%d requests/replies processed\n", count);
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.