Examples of recv()


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

        connectAssoc.reverse().associate(repSocket);
        connectAssoc.associate(reqSocket);

        byte[] msg = new byte[]{1};
        reqSocket.send(msg, 0);
        byte[] recv = repSocket.recv(0);
        assertEquals(msg, recv);

    }

    @Test
View Full Code Here

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

        assoc.associate(pullSocket);

        byte[] msg1 = new byte[]{1};
        byte[] msg2 = new byte[]{2, 2};
        pushSocket1.send(msg1, 0);
        byte[] recv1 = pullSocket.recv(0);
        assertEquals(recv1, msg1);
        pushSocket2.send(msg2, 0);
        byte[] recv2 = pullSocket.recv(0);
        assertEquals(recv2, msg2);
View Full Code Here

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

        byte[] msg2 = new byte[]{2, 2};
        pushSocket1.send(msg1, 0);
        byte[] recv1 = pullSocket.recv(0);
        assertEquals(recv1, msg1);
        pushSocket2.send(msg2, 0);
        byte[] recv2 = pullSocket.recv(0);
        assertEquals(recv2, msg2);


    }
View Full Code Here

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

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

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

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

        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

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

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

    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

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

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

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

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