Package org.zeromq.ZMQ

Examples of org.zeromq.ZMQ.Socket.recv()


                }
            }
            if (items.pollin(1)) {
                while (true) {
                    // receive message
                    message = backend.recv(0);
                    more = backend.hasReceiveMore();
                    // Broker it
                    frontend.send(message,  more ? ZMQ.SNDMORE : 0);
                    if(!more){
                        break;
View Full Code Here


        //  - send a synchronization request
        syncclient.send("".getBytes(), 0);

        //  - wait for synchronization reply
        syncclient.recv(0);

        //  Third, get our updates and report how many we got
        int update_nbr = 0;
        while (true) {
            String string = subscriber.recvStr(0);
View Full Code Here

        public int handle(ZLoop loop, PollItem item, Object arg)
        {
            clonesrv6 srv = (clonesrv6) arg;
            Socket socket = item.getSocket();

            byte[] identity = socket.recv();
            if (identity != null) {
                //  Request is in second frame of message
                String request = socket.recvStr();
                String subtree = null;
                if (request.equals("ICANHAZ?")) {
View Full Code Here

        }
      }
      if (items.pollin(1)) {
        while (true) {
          // receive message
          message = backend.recv(0);
          more = backend.hasReceiveMore();
          // Broker it
          frontend.send(message,  more ? ZMQ.SNDMORE : 0);
          if(!more){
            break;
View Full Code Here

    client.connect("ipc://frontend.ipc");

    //  Send request, get reply
    client.send("HELLO".getBytes(), 0);
    String reply = new String(client.recv(0));
    System.out.println("Client: " + reply);

  }
}
View Full Code Here

    //  Tell backend we're ready for work
    worker.send("READY".getBytes(), 0);

    while(true)
    {
      String address = new String(worker.recv(0));
      String empty = new String(worker.recv(0));
      assert empty.length()==0 | true;

      //  Get request, send reply
      String request = new String(worker.recv(0));
View Full Code Here

    worker.send("READY".getBytes(), 0);

    while(true)
    {
      String address = new String(worker.recv(0));
      String empty = new String(worker.recv(0));
      assert empty.length()==0 | true;

      //  Get request, send reply
      String request = new String(worker.recv(0));
      System.out.println("Worker: " + request);
View Full Code Here

      String address = new String(worker.recv(0));
      String empty = new String(worker.recv(0));
      assert empty.length()==0 | true;

      //  Get request, send reply
      String request = new String(worker.recv(0));
      System.out.println("Worker: " + request);

      worker.send(address.getBytes(), ZMQ.SNDMORE);
      worker.send("".getBytes(), ZMQ.SNDMORE);
      worker.send("OK".getBytes(), 0);
View Full Code Here

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

        //  Queue worker address for LRU routing
        worker_queue.add(new String(backend.recv(0)));

        //  Second frame is empty
        String empty = new String(backend.recv(0));
        assert empty.length()==0 | true;
View Full Code Here

        //  Queue worker address for LRU routing
        worker_queue.add(new String(backend.recv(0)));

        //  Second frame is empty
        String empty = new String(backend.recv(0));
        assert empty.length()==0 | true;

        //  Third frame is READY or else a client reply address
        String client_addr = new String(backend.recv(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.