Examples of recv()


Examples of org.apache.s4.client.Driver.recv()

                System.exit(1);          
            }

            // read all responses
            while (true) {
                Message response = d.recv();
                System.out.println(displayId + ":" + response);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of org.apache.s4.client.util.ByteArrayIOChannel.recv()

            ByteArrayIOChannel io = new ByteArrayIOChannel(sock);

            io.send(emptyBytes);

            byte[] b = io.recv();

            if (b == null || b.length == 0) {
                if (debug) {
                    System.err.println("Empty response during initialization.");
                }
View Full Code Here

Examples of org.apache.s4.util.ByteArrayIOChannel.recv()

        try {
            ClientConnection conn = null;

            ByteArrayIOChannel io = new ByteArrayIOChannel(s);

            v = io.recv();

            if (v == null || v.length == 0) {
                // no information => client initialization
                clientInit(io);
View Full Code Here

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

        Thread.sleep(1000);
        router.sendMore("A");
        router.sendMore(new byte[] {Persistence.MESSAGE_ERROR});
        router.send(new byte[] {Persistence.STATUS_INTERNAL_ERROR});

        assertEquals(dealer.recv()[0], Persistence.STATUS_INTERNAL_ERROR);

        dealer.close();
        router.close();
        ctx.term();
    }
View Full Code Here

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

        router.sendMore("A");
        router.sendMore(new byte[] {Persistence.MESSAGE_RESPONSE});
        router.sendMore(new byte[] {STATUS_OK});
        router.send(ByteBuffer.wrap(new byte[8]).putLong(100).array());

        assertEquals(dealer.recv()[0], STATUS_OK);
        assertEquals(dealer.recv().length, 8);

        dealer.close();
        router.close();
        ctx.term();
View Full Code Here

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

        router.sendMore(new byte[] {Persistence.MESSAGE_RESPONSE});
        router.sendMore(new byte[] {STATUS_OK});
        router.send(ByteBuffer.wrap(new byte[8]).putLong(100).array());

        assertEquals(dealer.recv()[0], STATUS_OK);
        assertEquals(dealer.recv().length, 8);

        dealer.close();
        router.close();
        ctx.term();
    }
View Full Code Here

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

        router.sendMore(new byte[] {STATUS_OK});
        router.sendMore(path);
        router.sendMore(ByteBuffer.wrap(new byte[8]).putLong(0).array());
        router.send(ByteBuffer.wrap(new byte[8]).putLong(329).array());

        assertEquals(dealer.recv()[0], STATUS_OK);
        ByteBuffer content = ByteBuffer.wrap(dealer.recv());

        assertEquals(content.limit(), 329);
        assertEquals(0, content.get());
        int length = content.get();
View Full Code Here

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

        router.sendMore(path);
        router.sendMore(ByteBuffer.wrap(new byte[8]).putLong(0).array());
        router.send(ByteBuffer.wrap(new byte[8]).putLong(329).array());

        assertEquals(dealer.recv()[0], STATUS_OK);
        ByteBuffer content = ByteBuffer.wrap(dealer.recv());

        assertEquals(content.limit(), 329);
        assertEquals(0, content.get());
        int length = content.get();
        assertEquals(5, length);
View Full Code Here

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

        public int handle(ZLoop loop, PollItem item, Object arg)
        {
            clonesrv5 srv = (clonesrv5) 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()

        System.out.println("Waiting subscribers");
        //  Get synchronization from subscribers
        int subscribers = 0;
        while (subscribers < SUBSCRIBERS_EXPECTED) {
            //  - wait for synchronization request
            syncservice.recv(0);

            //  - send synchronization reply
            syncservice.send("", 0);
            subscribers++;
        }
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.