Too much of "Looks like another instance is already running." #5584
This commit is contained in:
parent
232b56790a
commit
2681951bf9
|
@ -73,6 +73,7 @@ public class StartupFrame {
|
|||
public StartupFrame() {
|
||||
// AudioPlayback.start();
|
||||
String title = "rusEFI console version " + Launcher.CONSOLE_VERSION;
|
||||
log.info(title);
|
||||
frame = FrameHelper.createFrame(title).getFrame();
|
||||
frame.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
|
@ -221,6 +222,7 @@ public class StartupFrame {
|
|||
frame.add(content);
|
||||
frame.pack();
|
||||
setFrameIcon(frame);
|
||||
log.info("setVisible");
|
||||
frame.setVisible(true);
|
||||
UiUtils.centerWindow(frame);
|
||||
|
||||
|
|
|
@ -26,9 +26,12 @@ public class JustOneInstance {
|
|||
try {
|
||||
Socket clientSocket = new Socket();
|
||||
clientSocket.connect(new InetSocketAddress("localhost", PORT), LOCAL_CONNECTION_TIMEOUT_MS);
|
||||
System.out.println("*** Already running!");
|
||||
String msg = "*** Already running!";
|
||||
System.out.println(msg);
|
||||
log.info(msg);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
log.info("No other instances seem to be running");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +41,7 @@ public class JustOneInstance {
|
|||
@Override
|
||||
public void run() {
|
||||
ServerSocket serverSocket;
|
||||
log.info("server socket " + PORT);
|
||||
try {
|
||||
serverSocket = new ServerSocket(PORT, 1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue