minor console bug: double port open on launch
This commit is contained in:
parent
884d69b10c
commit
5cf3e5b559
|
@ -34,6 +34,7 @@ public class LinkManager {
|
|||
private final Logger logger;
|
||||
|
||||
private LinkConnector connector;
|
||||
private boolean isStarted;
|
||||
|
||||
public LinkManager(Logger logger) {
|
||||
this.logger = logger;
|
||||
|
@ -175,7 +176,15 @@ public class LinkManager {
|
|||
connector.connectAndReadConfiguration(stateListener);
|
||||
}
|
||||
|
||||
public LinkConnector getConnector() {
|
||||
return connector;
|
||||
}
|
||||
|
||||
public void start(String port) {
|
||||
if (isStarted) {
|
||||
throw new IllegalStateException("Already started");
|
||||
}
|
||||
isStarted = true;
|
||||
Objects.requireNonNull(port, "port");
|
||||
logger.info("LinkManager: Starting " + port);
|
||||
if (isLogViewerMode(port)) {
|
||||
|
|
|
@ -67,7 +67,7 @@ public class MainFrame {
|
|||
});
|
||||
|
||||
final LinkManager linkManager = consoleUI.uiContext.getLinkManager();
|
||||
linkManager.startAndConnect(consoleUI.port, new ConnectionStateListener() {
|
||||
linkManager.getConnector().connectAndReadConfiguration(new ConnectionStateListener() {
|
||||
@Override
|
||||
public void onConnectionFailed() {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue