Examples of ZLoop


Examples of org.zeromq.ZLoop

    public clonesrv5 ()
    {
        port = 5556;
        ctx = new ZContext();
        kvmap = new HashMap<String, kvmsg>();
        loop = new ZLoop();
        loop.verbose(false);

        //  Set up our clone server sockets
        snapshot  = ctx.createSocket(ZMQ.ROUTER);
        snapshot.bind(String.format("tcp://*:%d", port));
View Full Code Here

Examples of org.zeromq.ZLoop

    //  whether we're primary or backup server, as well as our local and
    //  remote endpoints to bind and connect to:
    public bstar(boolean primary, String local, String remote) {
        //  Initialize the Binary Star
        ctx = new ZContext();
        loop = new ZLoop();
        state = primary? State.STATE_PRIMARY: State.STATE_BACKUP;

        //  Create publisher for state going to peer
        statepub = ctx.createSocket(ZMQ.PUB);
        statepub.bind(local);
View Full Code Here

Examples of org.zeromq.ZLoop

        //  Queue of available workers
        arg.workers = new LinkedList<ZFrame> ();

        //  Prepare reactor and fire it up
        ZLoop reactor = new ZLoop ();
        PollItem item = new PollItem (arg.backend, ZMQ.Poller.POLLIN);
        reactor.addPoller (item, backendHandler, arg);
        reactor.start ();

        context.destroy ();
    }
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.