Class UnicastHeader

    • Constructor Detail

      • UnicastHeader

        public UnicastHeader()
      • UnicastHeader

        protected UnicastHeader​(byte type)
      • UnicastHeader

        protected UnicastHeader​(byte type,
                                long seqno)
      • UnicastHeader

        protected UnicastHeader​(byte type,
                                long seqno,
                                short conn_id,
                                boolean first)
    • Method Detail

      • getMagicId

        public short getMagicId()
        Description copied from class: Header
        Returns the magic-ID. If defined in jg-magic-map.xml, the IDs need to be the same
        Specified by:
        getMagicId in class Header
      • create

        public java.util.function.Supplier<? extends Header> create()
        Description copied from interface: Constructable
        Creates an instance of the class implementing this interface
      • createDataHeader

        public static UnicastHeader createDataHeader​(long seqno,
                                                     short conn_id,
                                                     boolean first)
      • createAckHeader

        public static UnicastHeader createAckHeader​(long seqno,
                                                    short conn_id,
                                                    int timestamp)
      • createSendFirstSeqnoHeader

        public static UnicastHeader createSendFirstSeqnoHeader​(int timestamp)
      • createXmitReqHeader

        public static UnicastHeader createXmitReqHeader()
      • createCloseHeader

        public static UnicastHeader createCloseHeader​(short conn_id)
      • type

        public byte type()
      • seqno

        public long seqno()
      • connId

        public short connId()
      • first

        public boolean first()
      • timestamp

        public int timestamp()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Header
      • type2Str

        public static java.lang.String type2Str​(byte t)
      • serializedSize

        public final int serializedSize()
        Description copied from interface: SizeStreamable
        Returns the size (in bytes) of the marshalled object
      • writeTo

        public void writeTo​(java.io.DataOutput out)
                     throws java.io.IOException
        The following types and fields are serialized:
         | DATA | seqno | conn_id | first |
         | ACK  | seqno | timestamp |
         | SEND_FIRST_SEQNO | timestamp |
         | CLOSE | conn_id |
         
        Throws:
        java.io.IOException
      • readFrom

        public void readFrom​(java.io.DataInput in)
                      throws java.io.IOException
        Description copied from interface: Streamable
        Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
        Throws:
        java.io.IOException