Examples of recv()


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

      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

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

      //  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

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

        //  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

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

        //  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));

        //  If client reply, send rest back to frontend
        if (!client_addr.equals("READY")) {

          empty = new String(backend.recv(0));
View Full Code Here

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

        String client_addr = new String(backend.recv(0));

        //  If client reply, send rest back to frontend
        if (!client_addr.equals("READY")) {

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

          String reply = new String(backend.recv(0));
          frontend.send(client_addr.getBytes(), ZMQ.SNDMORE);
          frontend.send("".getBytes(), ZMQ.SNDMORE);
View Full Code Here

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

        if (!client_addr.equals("READY")) {

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

          String reply = new String(backend.recv(0));
          frontend.send(client_addr.getBytes(), ZMQ.SNDMORE);
          frontend.send("".getBytes(), ZMQ.SNDMORE);
          frontend.send(reply.getBytes(), 0);

          if (--client_nbr == 0)
View Full Code Here

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

   
    System.out.println("launch and connect client.");

    for (int request_nbr = 0; request_nbr < 10; request_nbr++) {
      requester.send("Hello".getBytes(), 0);
      byte[] reply = requester.recv(0);
      String replyValue = new String(reply);
      System.out.println("Received reply "+request_nbr+" ["+replyValue+"]");
    }
   
    //  We never get here but clean up anyhow
View Full Code Here

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

   
    System.out.println("launch and connect server.");

    while (!Thread.currentThread().isInterrupted()) {
      //  Wait for next request from client
      byte[] request = responder.recv(0);
      String string = new String(request);
      System.out.println("Received request: ["+string+"].");

      //  Do some 'work'
      try {
View Full Code Here

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

    //  Get synchronization from subscribers
    int subscribers = 0;
    while (subscribers < SUBSCRIBERS_EXPECTED) {
      //  - wait for synchronization request
      byte[] value = syncservice.recv(0);

      //  - send synchronization reply
      syncservice.send("".getBytes(), 0);
      subscribers++;
    }
View Full Code Here

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

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

    //  - wait for synchronization reply
    byte[] value = syncclient.recv(0);

    //  Third, get our updates and report how many we got
    int update_nbr = 0;
    while (true) {
      byte[] stringValue = subscriber.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.