Class PacketHandler

Class PacketHandler

java.lang.Object
   |
   +----PacketHandler

public class PacketHandler
extends Object
RTP Packet Handler contains methods to assemble and disassemble incoming RTP packets received over the RTP multicast receiver socket

Constructor Index

 o PacketHandler(MenuWindow)
Constructor function to randomly generate sequence number, timestamp and SSRC.

Method Index

 o assemble(byte[])
Assembles data passed from Chat Tool or Whiteboard module with RTP header.
 o disassemble(DatagramPacket)
Segments the RTP header from the data portion of the incoming RTP packet, before updating a vector for keeping track of the number of active senders during a particular transmission interval.
 o getRTP_Header()
returns RTP header obtained from the disassemble function of this class
 o updateActiveSenderVec(int)
Checks whether the SSRC read from the incoming packet is already present in the vector.

Constructors

 o PacketHandler
  public PacketHandler(MenuWindow parent)
Constructor function to randomly generate sequence number, timestamp and SSRC. The SSRC generated is stored in the StateInfo class for reference by other parts of the program.

Methods

 o disassemble
  public byte[] disassemble(DatagramPacket pkt)
Segments the RTP header from the data portion of the incoming RTP packet, before updating a vector for keeping track of the number of active senders during a particular transmission interval. The RTP header is then stored and can be retrieved using getRTP_Header.
 o updateActiveSenderVec
  public void updateActiveSenderVec(int SSRCRead)
Checks whether the SSRC read from the incoming packet is already present in the vector. If not, add on to the vector and increment the variable : activeSenders.
 o assemble
  public byte[] assemble(byte data_buf[])
Assembles data passed from Chat Tool or Whiteboard module with RTP header. Function also pads data to 32-bit boundary and sets the padding bit of the header to 1 accordingly. @ return array of bytes pertaining to the assembled packet.
 o getRTP_Header
  public RTP_Header getRTP_Header()
returns RTP header obtained from the disassemble function of this class