View Javadoc

    1   /*
    2    * Created on Dec 22, 2004
    3    *
    4    * TODO To change the template for this generated file go to
    5    * Window - Preferences - Java - Code Style - Code Templates
    6    */
    7   package org.activeio.net;
    8
    9   import java.net.DatagramPacket;
    10  import java.net.InetAddress;
    11
    12
    13  final public class DatagramContext {
    14
    15      public InetAddress address;
    16      public Integer port;
    17
    18      public DatagramContext() {
    19      }
    20
    21      public DatagramContext(DatagramPacket datagramPacket) {
    22          this(datagramPacket.getAddress(), new Integer(datagramPacket.getPort()));
    23      }
    24
    25      public DatagramContext(InetAddress address, Integer port) {
    26          this.address = address;
    27          this.port = port;
    28      }
    29
    30      public InetAddress getAddress() {
    31          return address;
    32      }
    33
    34      public void setAddress(InetAddress address) {
    35          this.address = address;
    36      }
    37
    38      public Integer getPort() {
    39          return port;
    40      }
    41
    42      public void setPort(Integer port) {
    43          this.port = port;
    44      }
    45
    46  }