1
1
/*
2
- * Copyright (c) 2020, 2024 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2020, 2025 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
23
23
package org .openjdk .bench .java .net ;
24
24
25
25
import java .io .IOException ;
26
- import java .net .InetAddress ;
27
- import java .net .InetSocketAddress ;
28
26
import java .net .StandardProtocolFamily ;
29
27
import java .net .UnixDomainSocketAddress ;
30
- import java .nio .channels .ClosedChannelException ;
31
28
import java .nio .channels .ServerSocketChannel ;
32
29
import java .nio .channels .SocketChannel ;
33
30
import java .nio .file .*;
@@ -80,7 +77,6 @@ else if (family.equals("unix"))
80
77
81
78
82
79
private ServerSocketChannel getInetServerSocketChannel () throws IOException {
83
- InetAddress iaddr = InetAddress .getLoopbackAddress ();
84
80
return ServerSocketChannel .open ().bind (null );
85
81
}
86
82
@@ -97,11 +93,11 @@ public void beforeRun() throws IOException {
97
93
}
98
94
99
95
@ TearDown (Level .Trial )
100
- public void afterRun () throws IOException , InterruptedException {
96
+ public void afterRun () throws IOException {
101
97
ssc .close ();
102
98
if (family .equals ("unix" )) {
103
- Files .delete (socket );
104
- Files .delete (Path .of (tempDir ));
99
+ Files .deleteIfExists (socket );
100
+ Files .deleteIfExists (Path .of (tempDir ));
105
101
}
106
102
}
107
103
0 commit comments