logo

class

inet::UdpPacket

sys::Obj
  inet::UdpPacket
  1  //
  2  // Copyright (c) 2007, Brian Frank and Andy Frank
  3  // Licensed under the Academic Free License version 3.0
  4  //
  5  // History:
  6  //   9 Feb 07  Brian Frank  Creation
  7  //
  8  
  9  **
 10  ** UdpPacket encapsulates an IpAddress, port, and payload of bytes
 11  ** to send or receive from a UdpSocket.
 12  **
 13  class UdpPacket
 14  {
 15  
 16  //////////////////////////////////////////////////////////////////////////
 17  // Construction
 18  //////////////////////////////////////////////////////////////////////////
 19  
 20    **
 21    ** Construct a new UdpPacket.
 22    **
 23    new make(IpAddress addr := null, Int port := null, Buf data := null)
 24    {
 25      this.address = addr
 26      this.port = port
 27      this.data = data
 28    }
 29  
 30  //////////////////////////////////////////////////////////////////////////
 31  // Fields
 32  //////////////////////////////////////////////////////////////////////////
 33  
 34    **
 35    ** The send or receive IpAddress.  Defaults to null.
 36    **
 37    IpAddress address := null
 38  
 39    **
 40    ** The send or receive port number.  Defaults to null.
 41    **
 42    Int port := null
 43  
 44    **
 45    ** The payload to send or received.  Defaults to null.
 46    **
 47    Buf data := null
 48  
 49  }

More Info