Fixed issue with reloading card settings on start and hang on SSC/Smartmodem init

This commit is contained in:
Brendan Robert 2015-07-20 20:26:58 -05:00
parent d03dddf9ce
commit 07e68d463c
2 changed files with 12 additions and 9 deletions

View File

@ -492,8 +492,10 @@ public class Configuration implements Reconfigurable {
}
newRoot.getChildren().stream().forEach((child) -> {
String childName = child.toString();
ConfigNode oldChild = oldRoot.findChild(childName);
if (oldChild == null) {oldChild = oldRoot.findChild(child.id);}
// System.out.println("Applying settings for " + childName);
applyConfigTree(child, oldRoot.findChild(childName));
applyConfigTree(child, oldChild);
});
}

View File

@ -122,6 +122,15 @@ public class CardSSC extends Card implements Reconfigurable {
boolean newInputAvailable = false;
public void socketMonitor() {
try {
socket = new ServerSocket(IP_PORT);
socket.setReuseAddress(true);
socket.setSoTimeout(0);
} catch (IOException ex) {
Logger.getLogger(CardSSC.class.getName()).log(Level.SEVERE, null, ex);
suspend();
return;
}
while (socket != null && !socket.isClosed()) {
try {
Logger.getLogger(CardSSC.class.getName()).log(Level.INFO, "Slot " + getSlot() + " listening on port " + IP_PORT, (Throwable) null);
@ -458,19 +467,11 @@ public class CardSSC extends Card implements Reconfigurable {
TRANS_IRQ_ENABLED = false;
IRQ_TRIGGERED = false;
try {
socket = new ServerSocket(IP_PORT);
socket.setReuseAddress(true);
socket.setSoTimeout(0);
//socket.setReuseAddress(true);
listenThread = new Thread(this::socketMonitor);
listenThread.setDaemon(false);
listenThread.setName("SSC port listener, slot" + getSlot());
listenThread.start();
} catch (IOException ex) {
suspend();
Logger.getLogger(CardSSC.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}