public static void main (String [] args)
    {
        if (args.length != 3) {
            System.out.println ("usage: local_lat <bind-to> " +
                                "<message-size> <roundtrip-count>");
            return;
        }

        String bindTo = args [0];
        int messageSize = Integer.parseInt (args [1]);
        int roundtripCount = Integer.parseInt (args [2]);

        ZMQ.Context ctx = ZMQ.context (1);
        ZMQ.Socket s = ctx.socket (ZMQ.REP);

        //  Add your socket options here.
        //  For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.

        s.bind (bindTo);

        for (int i = 0; i != roundtripCount; i++) {
            byte [] data = s.recv (0);
            assert (data.length == messageSize);
            s.send (data, 0);
        }

        try {
            Thread.sleep (1000);
        }
        catch (InterruptedException e) {
            e.printStackTrace ();
        }

    }