diff --git a/app/src/main/java/io/xpipe/app/launcher/LauncherCommand.java b/app/src/main/java/io/xpipe/app/launcher/LauncherCommand.java index e9b5f1cc..e020c97e 100644 --- a/app/src/main/java/io/xpipe/app/launcher/LauncherCommand.java +++ b/app/src/main/java/io/xpipe/app/launcher/LauncherCommand.java @@ -13,6 +13,7 @@ import io.xpipe.beacon.exchange.FocusExchange; import io.xpipe.beacon.exchange.OpenExchange; import io.xpipe.core.process.OsType; import io.xpipe.core.util.XPipeDaemonMode; +import io.xpipe.core.util.XPipeInstallation; import lombok.SneakyThrows; import picocli.CommandLine; @@ -87,8 +88,9 @@ public class LauncherCommand implements Callable { OperationMode.halt(1); } } catch (Exception ex) { + var cli = XPipeInstallation.getLocalDefaultCliExecutable(); ErrorEvent.fromThrowable(ex).description("Unable to connect to existing running daemon instance as it did not respond." + - " Either try to kill the process xpiped manually or use the command xpipe daemon stop --force if the CLI is in your path.").handle(); + " Either try to kill the process xpiped manually or use the command " + cli + " daemon stop --force.").handle(); } // Even in case we are unable to reach another beacon server diff --git a/beacon/src/main/java/io/xpipe/beacon/BeaconClient.java b/beacon/src/main/java/io/xpipe/beacon/BeaconClient.java index 71cc6832..2e8a1628 100644 --- a/beacon/src/main/java/io/xpipe/beacon/BeaconClient.java +++ b/beacon/src/main/java/io/xpipe/beacon/BeaconClient.java @@ -21,8 +21,12 @@ import lombok.Getter; import lombok.Value; import lombok.extern.jackson.Jacksonized; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.StringWriter; import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.Socket; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -45,7 +49,8 @@ public class BeaconClient implements AutoCloseable { } public static BeaconClient connect(ClientInformation information) throws Exception { - var socket = new Socket(InetAddress.getLoopbackAddress(), BeaconConfig.getUsedPort()); + var socket = new Socket(); + socket.connect(new InetSocketAddress(InetAddress.getLoopbackAddress(), BeaconConfig.getUsedPort()), 5000); socket.setSoTimeout(5000); var client = new BeaconClient(socket, socket.getInputStream(), socket.getOutputStream()); client.sendObject(JacksonMapper.getDefault().valueToTree(information)); diff --git a/version b/version index a87ef26a..e2cb4ecb 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.7.9-2 \ No newline at end of file +1.7.9-3 \ No newline at end of file