test/jdk/java/net/Socket/asyncClose/BrokenPipe.java
changeset 55649 ad8e3b295615
parent 54811 9db7c0f561a6
child 58679 9c3209ff7550
equal deleted inserted replaced
55648:ba72dac556c3 55649:ad8e3b295615
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    55     }
    55     }
    56 
    56 
    57     public static void main(String[] args) throws Exception {
    57     public static void main(String[] args) throws Exception {
    58         IPSupport.throwSkippedExceptionIfNonOperational();
    58         IPSupport.throwSkippedExceptionIfNonOperational();
    59 
    59 
    60         ServerSocket ss = new ServerSocket(0);
    60         ServerSocket ss = new ServerSocket(0, 0, InetAddress.getLocalHost());
    61         Socket client = new Socket(InetAddress.getLocalHost(),
    61         Socket client = new Socket(InetAddress.getLocalHost(),
    62                                    ss.getLocalPort());
    62                                    ss.getLocalPort());
    63         Socket server = ss.accept();
    63         Socket server = ss.accept();
    64         ss.close();
    64         ss.close();
    65         new Thread(new Closer(server)).start();
    65         new Thread(new Closer(server)).start();