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

Add some additional diagnostic output to java/net/ipv6tests/UdpTest.java

XMLWordPrintable

    • b17

        amendments to open/test/jdk/java/net/ipv6tests/Tests.java

         add a diagnostics to print the ports of the two endpoints involved in the datagramEcho test scenario


           public static void datagramEcho (DatagramSocket s1, DatagramSocket s2,
                                             InetAddress ia2)
                throws Exception {

                byte[] ba = "Hello world".getBytes();
                DatagramPacket p1;

                SocketAddress dest2 = null;
                if (ia2 != null) {
                    dest2 = new InetSocketAddress (ia2, s2.getLocalPort());
                    p1 = new DatagramPacket (ba, ba.length, dest2);
                } else {
                    p1 = new DatagramPacket (ba, ba.length);
                }

                dprintln ("dest2 == " + dest2);
                dprintln ("sender endpoint == " + s1.getLocalSocketAddress());
                dprintln ("echo endpoint == " + s2.getLocalSocketAddress());

                DatagramPacket r1 = new DatagramPacket (new byte[256], 256);
                DatagramPacket r2 = new DatagramPacket (new byte[256], 256);

                s1.send (p1);
                s2.receive (r1);
                s2.send (r1);
                s1.receive (r2);
                comparePackets (p1, r1);
                comparePackets (p1, r2);
            }

              ssachkov Serhiy Sachkov
              msheppar Mark Sheppard
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: