jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java
changeset 16480 fcad3b6ec812
parent 5506 202f599c92aa
child 23010 6dadb192ad81
equal deleted inserted replaced
16479:d845c18d13f2 16480:fcad3b6ec812
   131         int port = dc.socket().getLocalPort();
   131         int port = dc.socket().getLocalPort();
   132         launch(className, options, args, Util.getFD(dc));
   132         launch(className, options, args, Util.getFD(dc));
   133         dc.close();
   133         dc.close();
   134 
   134 
   135         dc = DatagramChannel.open();
   135         dc = DatagramChannel.open();
   136 
   136         InetAddress address = InetAddress.getLocalHost();
   137         InetSocketAddress isa = new InetSocketAddress(InetAddress.getLocalHost(), port);
   137         if (address.isLoopbackAddress()) {
       
   138             address = InetAddress.getLoopbackAddress();
       
   139         }
       
   140         InetSocketAddress isa = new InetSocketAddress(address, port);
   138 
   141 
   139         dc.connect(isa);
   142         dc.connect(isa);
   140         return dc;
   143         return dc;
   141     }
   144     }
   142 
   145