Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4901327

DatagramPacket - need access to destination of received packet

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2
    • core-libs
    • x86
    • windows_2000



      Name: gm110360 Date: 08/05/2003


      A DESCRIPTION OF THE REQUEST :
      When a DatagramPacket is received using the DatagramSocket.receive() call, there does not seem to be any way to get the destination address to which the packet was sent. The getAddress() method returns the address of the sender for a received packet.

      JUSTIFICATION :
      An application may want to take a different action based on whether the destination address was unicast or broadcast - i.e., did my application receive this alone, or did everyone else also receive this packet?

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would like to see additional methods provided to get the destination address and port to which the packet was sent.
      ACTUAL -
      Methods do not exist - actual behavior of getting destination address is not possible.

      ---------- BEGIN SOURCE ----------
      Not applicable.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround - simply cannot get the destination address of incoming packets.
      (Incident Review ID: 191382)
      ======================================================================

            jccollet Jean-Christophe Collet (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: