Package org.zeromq.ZMQ

Examples of org.zeromq.ZMQ.Context.socket()


            return;
       
        Context context = ZMQ.context(1);
        Event event;
       
        Socket socket = context.socket(ZMQ.REP);
        Socket monitor = context.socket(ZMQ.PAIR);
        Socket helper = context.socket(ZMQ.REQ);
        monitor.setReceiveTimeOut(100);
       
        int port = socket.bindToRandomPort("tcp://127.0.0.1");
View Full Code Here


       
        Context context = ZMQ.context(1);
        Event event;
       
        Socket socket = context.socket(ZMQ.REP);
        Socket monitor = context.socket(ZMQ.PAIR);
        Socket helper = context.socket(ZMQ.REQ);
        monitor.setReceiveTimeOut(100);
       
        int port = socket.bindToRandomPort("tcp://127.0.0.1");
        helper.connect("tcp://127.0.0.1:" + port);
View Full Code Here

        Context context = ZMQ.context(1);
        Event event;
       
        Socket socket = context.socket(ZMQ.REP);
        Socket monitor = context.socket(ZMQ.PAIR);
        Socket helper = context.socket(ZMQ.REQ);
        monitor.setReceiveTimeOut(100);
       
        int port = socket.bindToRandomPort("tcp://127.0.0.1");
        helper.connect("tcp://127.0.0.1:" + port);
       
View Full Code Here

            return;
       
        Context context = ZMQ.context(1);
        Event event;
       
        Socket socket = context.socket(ZMQ.REP);
        Socket monitor = context.socket(ZMQ.PAIR);
        monitor.setReceiveTimeOut(100);
       
        assertTrue(socket.monitor("inproc://monitor.socket", ZMQ.EVENT_MONITOR_STOPPED));
        monitor.connect("inproc://monitor.socket");
View Full Code Here

       
        Context context = ZMQ.context(1);
        Event event;
       
        Socket socket = context.socket(ZMQ.REP);
        Socket monitor = context.socket(ZMQ.PAIR);
        monitor.setReceiveTimeOut(100);
       
        assertTrue(socket.monitor("inproc://monitor.socket", ZMQ.EVENT_MONITOR_STOPPED));
        monitor.connect("inproc://monitor.socket");
       
View Full Code Here

    @Test
    public void testOffset() throws Exception
    {
        Context ctx = ZMQ.context(1);
        Socket sock = ctx.socket(ZMQ.DEALER);

        ZLog zlog = ZLogManager.instance().get(topic);
        SegmentInfo[] infos = zlog.segments();

        sock.setIdentity(ZPUtils.genTopicIdentity(topic, 0));
View Full Code Here

    @Test
    public void testFetch() throws Exception
    {
        Context ctx = ZMQ.context(1);
        Socket sock = ctx.socket(ZMQ.DEALER);

        ZLog zlog = ZLogManager.instance().get(topic);
        SegmentInfo[] infos = zlog.segments();
        SegmentInfo last = infos[infos.length - 1];
View Full Code Here

    @Test
    public void testError() throws Exception
    {

        Context ctx = ZMQ.context(1);
        Socket router = ctx.socket(ZMQ.ROUTER);
        router.bind("tcp://127.0.0.1:6001");
        router.setEncoder(Persistence.PersistEncoder.class);

        Socket dealer = ctx.socket(ZMQ.DEALER);
        dealer.setIdentity("A".getBytes());
View Full Code Here

        Context ctx = ZMQ.context(1);
        Socket router = ctx.socket(ZMQ.ROUTER);
        router.bind("tcp://127.0.0.1:6001");
        router.setEncoder(Persistence.PersistEncoder.class);

        Socket dealer = ctx.socket(ZMQ.DEALER);
        dealer.setIdentity("A".getBytes());
        dealer.connect("tcp://127.0.0.1:6001");

        Thread.sleep(1000);
        router.sendMore("A");
View Full Code Here

    @Test
    public void testResponse() throws Exception
    {

        Context ctx = ZMQ.context(1);
        Socket router = ctx.socket(ZMQ.ROUTER);
        router.bind("tcp://127.0.0.1:6002");
        router.setEncoder(Persistence.PersistEncoder.class);

        Socket dealer = ctx.socket(ZMQ.DEALER);
        dealer.setIdentity("A".getBytes());
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.