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

java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.java may fail with address already in use

XMLWordPrintable

    • b102
    • Not verified

        java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.java uses static port, may fail with java.net.BindException: Address already in use

            DatagramPacket packet = new DatagramPacket(buf, buf.length, address, 4445);
        ...
            socket = new DatagramSocket(4445);

        ----------System.err:(11/656)----------
        setting DatagramSocketImplFactory...
        Exception in thread "main" java.net.BindException: Address already in use
        at java.net.PlainDatagramSocketImpl.bind0(Native Method)
        at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:94)
        at java.net.DatagramSocket.bind(DatagramSocket.java:394)
        at java.net.DatagramSocket.<init>(DatagramSocket.java:244)
        at java.net.DatagramSocket.<init>(DatagramSocket.java:301)
        at java.net.DatagramSocket.<init>(DatagramSocket.java:273)
        at QuoteServerThread.<init>(ADatagramSocket.java:77)
        at QuoteServerThread.<init>(ADatagramSocket.java:72)
        at ADatagramSocket.main(ADatagramSocket.java:44)

              xiaofeya Xiaofeng Yang
              amlu Amy Lu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: