public ControllerIO(IController l) {
this.listener = l;
this.openFlowPort = defaultOpenFlowPort;
- String portString = System.getProperty("port");
+ String portString = System.getProperty("of.listenPort");
if (portString != null) {
try {
openFlowPort = Short.decode(portString).shortValue();
serverSelectionKey);
}
}
- } catch (IOException e) {
- logger.error("Caught I/O Exception: " + e.toString());
- return;
+ } catch (Exception e) {
+ continue;
}
}
}
logger.info("Controller is now listening on port " + openFlowPort);
}
- public void shutDown() {
+ public void shutDown() throws IOException {
this.running = false;
this.selector.wakeup();
- try {
- this.serverSocket.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
+ this.serverSocket.close();
}
}