Search in sources :

Example 1 with TpHeader

use of org.jgroups.protocols.TpHeader in project JGroups by belaban.

the class MessageTest method addHeaders.

protected 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).clusterName("demo-cluster");
    msg.putHeader(PING_ID, ping_hdr);
    NakAckHeader2 nak_hdr = NakAckHeader2.createXmitRequestHeader(Util.createRandomAddress("S"));
    msg.putHeader(NAKACK_ID, nak_hdr);
}
Also used : NakAckHeader2(org.jgroups.protocols.pbcast.NakAckHeader2) PingHeader(org.jgroups.protocols.PingHeader) TpHeader(org.jgroups.protocols.TpHeader)

Example 2 with TpHeader

use of org.jgroups.protocols.TpHeader in project JGroups by belaban.

the class MessageSizeTest method createMessage.

static Message createMessage(Address dest, Address src) {
    Message msg = new Message(dest, "hello world").src(src);
    msg.putHeader(NAKACK_ID, NakAckHeader2.createMessageHeader(322649));
    msg.putHeader(UNICAST_ID, UnicastHeader3.createDataHeader(465784, (short) 23323, true));
    msg.putHeader(UDP_ID, new TpHeader("DrawDemo"));
    return msg;
}
Also used : Message(org.jgroups.Message) TpHeader(org.jgroups.protocols.TpHeader)

Example 3 with TpHeader

use of org.jgroups.protocols.TpHeader in project JGroups by belaban.

the class StreamableTest method testHeaders.

public static void testHeaders() throws Exception {
    Address dest = UUID.randomUUID();
    Address src = UUID.randomUUID();
    Message msg = new Message(dest, "Hello world".getBytes()).src(src);
    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);
}
Also used : PingHeader(org.jgroups.protocols.PingHeader) TpHeader(org.jgroups.protocols.TpHeader)

Aggregations

TpHeader (org.jgroups.protocols.TpHeader)3 PingHeader (org.jgroups.protocols.PingHeader)2 Message (org.jgroups.Message)1 NakAckHeader2 (org.jgroups.protocols.pbcast.NakAckHeader2)1