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

multiple JAVA applications can't bind to the same UDP port on the same machine

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.4.0
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      x86
    • OS:
      windows_nt

      Description

      This is a similar problem to bug id 4137483 but for UDP sockets. The
      customer specific description is below.

      We currently have a set of distributed C++ applications that are communicating via UDP on a specified port. Within these applications, the SO_REUSEADDR option for that port so that multiple applications on the same host can send and receive datagram packets via the same port. We a trying to augment these applications with a specialized JAVA application that will extract datagram packets that are both sent and received on a particular machine.

      If the C++ applications are running, we get and "address in use" socket exception when we attempt to run the JAVA application. The only way we can circumvent this problem is to start the JAVA application first and then start the C++ applications. If we do this, we do not get an exception; however, this method is not feasible since we usually do not have control over when the C++ applications are started.

      I have looked within the JDK documentation and there does not appear to be anyway of setting this option or any option within the DatagramSocket or the DatagramPacket class. There are two routines within the JDK classes.zip: PlainDatagramSocketImpl (synchronized class) and SocketOptions (interface) that have access the SO_REUSEADDR option and can set it. However, there does not appear to be anyway to use these routines.

      Is there anyway, we can have multiple JAVA applications bind to the same UDP port on the same machine. Any help would be greatly appreciated.

        Attachments

          Activity

            People

            Assignee:
            jccollet Jean-Christophe Collet (Inactive)
            Reporter:
            atongschsunw Albert Tong-schmidt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: