mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8225430: Replace wildcard address with loopback or local host in tests - part 14
Reviewed-by: dfuchs, chegar, vtewari
This commit is contained in:
parent
9f7cbf60e4
commit
4312f54e51
12 changed files with 108 additions and 52 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -44,9 +44,11 @@ public class TestClose {
|
|||
InetAddress ad1, ad2;
|
||||
int port1, port2, serverport;
|
||||
|
||||
ss = new ServerSocket(0);
|
||||
InetAddress loopback = InetAddress.getLoopbackAddress();
|
||||
ss = new ServerSocket();
|
||||
ss.bind(new InetSocketAddress(loopback, 0));
|
||||
serverport = ss.getLocalPort();
|
||||
s = new Socket("localhost", serverport);
|
||||
s = new Socket(loopback, serverport);
|
||||
s.close();
|
||||
ss.close();
|
||||
ad1 = ss.getInetAddress();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue