diff --git a/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java b/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java index 7c300e6222..db0fa6a4f4 100644 --- a/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java +++ b/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java @@ -6,7 +6,7 @@ import java.net.URL; import java.util.concurrent.atomic.AtomicReference; public class rusEFIVersion { - public static final int CONSOLE_VERSION = 20230917; + public static final int CONSOLE_VERSION = 20230925; public static AtomicReference firmwareVersion = new AtomicReference<>("N/A"); public static long classBuildTimeMillis() { diff --git a/java_console/ui/src/main/java/com/rusefi/ui/util/JustOneInstance.java b/java_console/ui/src/main/java/com/rusefi/ui/util/JustOneInstance.java index 585c7f5682..2c234e9203 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/util/JustOneInstance.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/util/JustOneInstance.java @@ -1,13 +1,14 @@ package com.rusefi.ui.util; import java.io.IOException; +import java.io.PrintWriter; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; /** * This class is used to figure out if we have multiple instances of rusEfi console running - * + *

* Andrey Belomutskiy, (c) 2013-2020 * 5/4/2015 */ @@ -39,8 +40,7 @@ public class JustOneInstance { while (true) { // Wait for a connection Socket clientSocket = serverSocket.accept(); - // System.out.println("*** Got a connection! "); - clientSocket.close(); + handleConnection(clientSocket); } } catch (IOException e) { } @@ -48,4 +48,11 @@ public class JustOneInstance { }; new Thread(runnable, "JustOneInstance").start(); } + + private static void handleConnection(Socket clientSocket) throws IOException { + try (clientSocket) { + PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); + out.println(new java.util.Date() + "Already running " + ProcessHandle.current().pid() + "\r\n"); + } + } }