test/jdk/java/net/Socket/UdpSocket.java
branchniosocketimpl-branch
changeset 57313 14b02c7b27b8
parent 57309 dbd1beb994ab
child 57341 733e9746d615
equal deleted inserted replaced
57312:36c96936c5bc 57313:14b02c7b27b8
   135     private Socket newUdpSocket() throws IOException {
   135     private Socket newUdpSocket() throws IOException {
   136         return new Socket(InetAddress.getLoopbackAddress(), 8000, false);
   136         return new Socket(InetAddress.getLoopbackAddress(), 8000, false);
   137     }
   137     }
   138 
   138 
   139     private static void closeAll(Deque<Socket> sockets) throws IOException {
   139     private static void closeAll(Deque<Socket> sockets) throws IOException {
   140         sockets.forEach(s -> {
   140         Socket s;
   141             try { s.close(); } catch (IOException ignore) { }
   141         while ((s = sockets.poll()) != null) {
   142         });
   142             s.close();
       
   143         }
   143     }
   144     }
   144 }
   145 }