|
@@ -6,7 +6,9 @@ import org.slf4j.LoggerFactory;
|
|
|
import java.io.IOException;
|
|
|
import java.net.UnixDomainSocketAddress;
|
|
|
import java.nio.channels.SocketChannel;
|
|
|
+import java.nio.file.Files;
|
|
|
import java.nio.file.Path;
|
|
|
+import java.nio.file.attribute.BasicFileAttributes;
|
|
|
import java.util.concurrent.Executor;
|
|
|
|
|
|
class Client implements IpcCommunicator {
|
|
@@ -20,6 +22,8 @@ class Client implements IpcCommunicator {
|
|
|
}
|
|
|
|
|
|
public static Client create(Path socketPath) throws IOException {
|
|
|
+ // fail with NoSuchFileException early to prevent implicit creation of socket on Windows:
|
|
|
+ socketPath.getFileSystem().provider().checkAccess(socketPath);
|
|
|
var address = UnixDomainSocketAddress.of(socketPath);
|
|
|
var socketChannel = SocketChannel.open(address);
|
|
|
LOG.info("Connected to IPC server on UNIX socket {}", socketPath);
|