11/*
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.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
3232import java .net .InetAddress ;
3333import java .net .InetSocketAddress ;
3434import java .net .SocketAddress ;
35- import java .net .UnixDomainSocketAddress ;
36- import java .net .StandardProtocolFamily ;
3735import java .net .StandardSocketOptions ;
3836import java .nio .*;
3937import java .nio .channels .*;
@@ -164,10 +162,6 @@ public void run() {
164162 try {
165163 if (ssc != null )
166164 ssc .close ();
167- if (sa instanceof UnixDomainSocketAddress ) {
168- Path path = ((UnixDomainSocketAddress ) sa ).getPath ();
169- Files .deleteIfExists (path );
170- }
171165 } catch (IOException e2 ) {}
172166 }
173167 }
@@ -184,8 +178,7 @@ public void run() {
184178 /**
185179 * Creates Pipe implementation that supports optionally buffering.
186180 *
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
189182 * disabled then it sets TCP_NODELAY on the sink channel.
190183 */
191184 @ SuppressWarnings ("removal" )
@@ -212,23 +205,8 @@ public SinkChannelImpl sink() {
212205 return sink ;
213206 }
214207
215- private static volatile boolean noUnixDomainSockets ;
216-
217208 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 ();
232210 InetAddress lb = InetAddress .getLoopbackAddress ();
233211 listener .bind (new InetSocketAddress (lb , 0 ));
234212 return listener ;
0 commit comments