Package org.zeromq.ZMQ

Examples of org.zeromq.ZMQ.Poller.poll()


    byte[] message;

    //  Switch messages between sockets
    while (!Thread.currentThread().isInterrupted()) {     
      //  poll and memorize multipart detection
      items.poll();

      if (items.pollin(0)) {
        while (true) {
          // receive message
          message = frontend.recv(0);
View Full Code Here


      //  Poll front-end only if we have available workers
      if(worker_queue.size()>0)
        items.register(frontend, Poller.POLLIN);

      items.poll();

      //  Handle worker activity on backend
      if (items.pollin(0)) {

        //  Queue worker address for LRU routing
View Full Code Here

                        Server server = self.servers [serverNbr];
                        items.register (server.dealer, Poller.POLLIN);
                    }
                }

                if (items.poll (self.heartbeat) == -1)
                    break;              //  Context has been shut down

                //  Process incoming messages; either of these can
                //  throw events into the state machine
                if (items.pollin (0))
View Full Code Here

                //  Calculate tickless timer, up to interval seconds
                long tickless = System.currentTimeMillis () + self.monitor;
                tickless = clientTickless (self.clients, tickless);

                //  Poll until at most next timer event
                long rc = items.poll (tickless - System.currentTimeMillis ());
                if (rc == -1)
                    break;              //  Context has been shut down

                //  Process incoming message from either socket
                if (items.pollin (0))
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.