Package org.zeromq

Examples of org.zeromq.ZMsg.addString()


        mdcliapi clientSession = new mdcliapi("tcp://localhost:5555", verbose);

        ZMsg request = new ZMsg();

        // This is the service we want to look up
        request.addString("echo");

        // This is the service we send our request to
        ZMsg reply = clientSession.send("mmi.service", request);

        if (reply != null) {
View Full Code Here


        mdcliapi clientSession = new mdcliapi("tcp://localhost:5555", verbose);

        int count;
        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
View Full Code Here

            System.out.println("Synchronous round-trip test");
            start = System.currentTimeMillis();

            for (requests = 0; requests < SAMPLE_SIZE; requests++) {
                ZMsg req = new ZMsg();
                req.addString("hello");
                req.send(client);
                ZMsg.recvMsg(client).destroy();
            }

            System.out.printf(" %d calls/second\n",
View Full Code Here

            System.out.println("Asynchronous round-trip test");
            start = System.currentTimeMillis();

            for (requests = 0; requests < SAMPLE_SIZE; requests++) {
                ZMsg req = new ZMsg();
                req.addString("hello");
                req.send(client);
            }
            for (requests = 0; requests < SAMPLE_SIZE
                    && !Thread.currentThread().isInterrupted(); requests++) {
                ZMsg.recvMsg(client).destroy();
View Full Code Here

        mdcliapi2 clientSession = new mdcliapi2("tcp://localhost:5555", verbose);

        int count;
        for (count = 0; count < 100000; count++) {
            ZMsg request = new ZMsg();
            request.addString("Hello world");
            clientSession.send("echo", request);
        }
        for (count = 0; count < 100000; count++) {
            ZMsg reply = clientSession.recv();
            if (reply != null)
View Full Code Here

    private void processEvents() {
        while (running.get()) {
            try {
                final StatsEMsgBuilder msg = events.take();
                final ZMsg zmsg = makeZMsg();
                zmsg.addString(msg.getHeader());
                zmsg.addString(msg.getBody());
                zmsg.send(publisher);
            } catch (InterruptedException e) {
                LOG.warn("StatsE sender interrupted.");
            } catch (Throwable t) {
View Full Code Here

        while (running.get()) {
            try {
                final StatsEMsgBuilder msg = events.take();
                final ZMsg zmsg = makeZMsg();
                zmsg.addString(msg.getHeader());
                zmsg.addString(msg.getBody());
                zmsg.send(publisher);
            } catch (InterruptedException e) {
                LOG.warn("StatsE sender interrupted.");
            } catch (Throwable t) {
                LOG.error("Internal StatsE/ZMQ error", t);
View Full Code Here

            System.out.println("Synchronous round-trip test...");
            start = System.currentTimeMillis();

            for (requests = 0; requests < SAMPLE_SIZE; requests++) {
                ZMsg req = new ZMsg();
                req.addString("hello");
                req.send(client);
                ZMsg.recvMsg(client).destroy();
            }

            System.out.printf(" %d calls/second\n",
View Full Code Here

            System.out.println("Asynchronous round-trip test...");
            start = System.currentTimeMillis();

            for (requests = 0; requests < SAMPLE_SIZE; requests++) {
                ZMsg req = new ZMsg();
                req.addString("hello");
                req.send(client);
            }
            for (requests = 0; requests < SAMPLE_SIZE
                    && !Thread.currentThread().isInterrupted(); requests++) {
                ZMsg.recvMsg(client).destroy();
View Full Code Here

        mdcliapi clientSession = new mdcliapi("tcp://localhost:5555", verbose);

        int count;
        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
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.