1
1
/*
2
- * Copyright (c) 2002, 2021 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2002, 2022 , 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
32
32
import java .net .InetAddress ;
33
33
import java .net .InetSocketAddress ;
34
34
import java .net .SocketAddress ;
35
- import java .net .UnixDomainSocketAddress ;
36
- import java .net .StandardProtocolFamily ;
37
35
import java .net .StandardSocketOptions ;
38
36
import java .nio .*;
39
37
import java .nio .channels .*;
@@ -164,10 +162,6 @@ public void run() {
164
162
try {
165
163
if (ssc != null )
166
164
ssc .close ();
167
- if (sa instanceof UnixDomainSocketAddress ) {
168
- Path path = ((UnixDomainSocketAddress ) sa ).getPath ();
169
- Files .deleteIfExists (path );
170
- }
171
165
} catch (IOException e2 ) {}
172
166
}
173
167
}
@@ -184,8 +178,7 @@ public void run() {
184
178
/**
185
179
* Creates Pipe implementation that supports optionally buffering.
186
180
*
187
- * @implNote The pipe uses Unix domain sockets where possible. It uses a
188
- * loopback connection on older editions of Windows. When buffering is
181
+ * @implNote Uses a loopback connection. When buffering is
189
182
* disabled then it sets TCP_NODELAY on the sink channel.
190
183
*/
191
184
@ SuppressWarnings ("removal" )
@@ -212,23 +205,8 @@ public SinkChannelImpl sink() {
212
205
return sink ;
213
206
}
214
207
215
- private static volatile boolean noUnixDomainSockets ;
216
-
217
208
private static ServerSocketChannel createListener () throws IOException {
218
- ServerSocketChannel listener = null ;
219
- if (!noUnixDomainSockets ) {
220
- try {
221
- listener = ServerSocketChannel .open (StandardProtocolFamily .UNIX );
222
- return listener .bind (null );
223
- } catch (UnsupportedOperationException | IOException e ) {
224
- // IOException is most likely to be caused by the temporary directory
225
- // name being too long. Possibly should log this.
226
- noUnixDomainSockets = true ;
227
- if (listener != null )
228
- listener .close ();
229
- }
230
- }
231
- listener = ServerSocketChannel .open ();
209
+ ServerSocketChannel listener = ServerSocketChannel .open ();
232
210
InetAddress lb = InetAddress .getLoopbackAddress ();
233
211
listener .bind (new InetSocketAddress (lb , 0 ));
234
212
return listener ;
0 commit comments