Package org.jgroups.protocols

Examples of org.jgroups.protocols.PingHeader


    }

    private static void addHeaders(Message msg) {      
        TpHeader tp_hdr=new TpHeader("DemoChannel2");
        msg.putHeader(UDP_ID, tp_hdr);
        PingHeader ping_hdr=new PingHeader(PingHeader.GET_MBRS_REQ, "demo-cluster");
        msg.putHeader(PING_ID, ping_hdr);
        NakAckHeader nak_hdr=NakAckHeader.createXmitRequestHeader(100, 104, null);
        msg.putHeader(NAKACK_ID, nak_hdr);
    }
View Full Code Here


    public void testHeaders() throws Exception {
        Address dest, src;
        dest=new IpAddress("228.1.2.3", 5555);
        src=new IpAddress("127.0.0.1", 6666);
        Message msg=new Message(dest, src, "Hello world".getBytes());
        PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ, new PingRsp(src, src, true));
        msg.putHeader("ping-header", hdr);
        UdpHeader udp_hdr=new UdpHeader("bla");
        msg.putHeader("udp-header", udp_hdr);
        stream(msg);
    }
View Full Code Here

        dest=new IpAddress("228.1.2.3", 5555);
        dest.setAdditionalData("foo".getBytes());
        src=new IpAddress("127.0.0.1", 6666);
        src.setAdditionalData("foobar".getBytes());
        Message msg=new Message(dest, src, "Hello world".getBytes());
        PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ, new PingRsp(src, src, false));
        msg.putHeader("ping-header", hdr);
        UdpHeader udp_hdr=new UdpHeader("bla");
        msg.putHeader("udp-header", udp_hdr);
        stream(msg);
    }
View Full Code Here

    public void testDifferentAddress() throws Exception {
        Address dest, src;
        dest=new WanPipeAddress("foo");
        src=new WanPipeAddress("foobar");
        Message msg=new Message(dest, src, "Hello world".getBytes());
        PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ, new PingRsp(src, src, false));
        msg.putHeader("ping-header", hdr);
        UdpHeader udp_hdr=new UdpHeader("bla");
        msg.putHeader("udp-header", udp_hdr);
        stream(msg);
    }
View Full Code Here

    private void addHeaders(Message msg) {
        UdpHeader udp_hdr=new UdpHeader("DemoChannel");
        msg.putHeader("UDP", udp_hdr);
        TpHeader tp_hdr=new TpHeader("DemoChannel2");
        msg.putHeader("TP", tp_hdr);
        PingHeader ping_hdr=new PingHeader(PingHeader.GET_MBRS_REQ, null);
        msg.putHeader("PING", ping_hdr);
        NakAckHeader nak_hdr=new NakAckHeader(NakAckHeader.XMIT_REQ, 100, 104);
        msg.putHeader("NAKACK", nak_hdr);
    }
View Full Code Here

    public void testHeaders() throws Exception {
        Address dest, src;
        dest=new IpAddress("228.1.2.3", 5555);
        src=new IpAddress("127.0.0.1", 6666);
        Message msg=new Message(dest, src, "Hello world".getBytes());
        PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ, new PingRsp(src, src, true));
        msg.putHeader("ping-header", hdr);
        UdpHeader udp_hdr=new UdpHeader("bla");
        msg.putHeader("udp-header", udp_hdr);
        stream(msg);
    }
View Full Code Here

        dest=new IpAddress("228.1.2.3", 5555);
        dest.setAdditionalData("foo".getBytes());
        src=new IpAddress("127.0.0.1", 6666);
        src.setAdditionalData("foobar".getBytes());
        Message msg=new Message(dest, src, "Hello world".getBytes());
        PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ, new PingRsp(src, src, false));
        msg.putHeader("ping-header", hdr);
        UdpHeader udp_hdr=new UdpHeader("bla");
        msg.putHeader("udp-header", udp_hdr);
        stream(msg);
    }
View Full Code Here

    private void addHeaders(Message msg) {
        UdpHeader udp_hdr=new UdpHeader("DemoChannel");
        msg.putHeader("UDP", udp_hdr);
        TpHeader tp_hdr=new TpHeader("DemoChannel2");
        msg.putHeader("TP", tp_hdr);
        PingHeader ping_hdr=new PingHeader(PingHeader.GET_MBRS_REQ, null);
        msg.putHeader("PING", ping_hdr);
        NakAckHeader nak_hdr=new NakAckHeader(NakAckHeader.XMIT_REQ, 100, 104);
        msg.putHeader("NAKACK", nak_hdr);
    }
View Full Code Here

        }

        public Object down(Event evt) {
            if(evt.getType() == Event.MSG) {
                Message msg=(Message)evt.getArg();
                PingHeader hdr=(PingHeader)msg.getHeader("TCPPING");
                if(hdr != null && hdr.type == PingHeader.GET_MBRS_REQ) {
                    pinged.add(msg.getDest());
                }
            }
View Full Code Here

    public static void testHeaders() throws Exception {
        Address dest=UUID.randomUUID();
        Address src=UUID.randomUUID();
        Message msg=new Message(dest, src, "Hello world".getBytes());
        PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ);
        msg.putHeader(PING_ID, hdr);
        TpHeader udp_hdr=new TpHeader("bla");
        msg.putHeader(UDP_ID, udp_hdr);
        stream(msg);
    }
View Full Code Here

TOP

Related Classes of org.jgroups.protocols.PingHeader

Copyright © 2018 www.massapicom. 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.