test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java
changeset 54887 442e22c051f0
parent 47216 71c04702a3d5
equal deleted inserted replaced
54886:4dd7ea5f28cf 54887:442e22c051f0
     1 /*
     1 /*
     2  * Copyright (c) 2001, 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.
    63         }
    63         }
    64     }
    64     }
    65 
    65 
    66     public AsyncCloseTest go() {
    66     public AsyncCloseTest go() {
    67         try {
    67         try {
    68             ServerSocket ss = new ServerSocket(0);
       
    69             InetAddress lh = InetAddress.getLocalHost();
    68             InetAddress lh = InetAddress.getLocalHost();
       
    69             ServerSocket ss = new ServerSocket(0, 0, lh);
    70             s.connect( new InetSocketAddress(lh, ss.getLocalPort()) );
    70             s.connect( new InetSocketAddress(lh, ss.getLocalPort()) );
    71             Socket s2 = ss.accept();
    71             Socket s2 = ss.accept();
    72             Thread thr = new Thread(this);
    72             Thread thr = new Thread(this);
    73             thr.start();
    73             thr.start();
    74             latch.await();
    74             latch.await();