mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-19 17:16:53 -04:00
yet another attempt to skip client connection attempts for non-existing socket files
This commit is contained in:
@@ -22,8 +22,6 @@ 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);
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
@@ -31,7 +32,9 @@ public interface IpcCommunicator extends Closeable {
|
||||
Preconditions.checkArgument(socketPaths.iterator().hasNext(), "socketPaths must contain at least one element");
|
||||
for (var p : socketPaths) {
|
||||
try {
|
||||
return Client.create(p);
|
||||
if (Files.exists(p)) {
|
||||
return Client.create(p);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// attempt next socket path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user