Merge "Web UI Branding support This fix provides an extensible branding support with...
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / core / internal / ControllerIO.java
index e1bc2d0c1446a9c6e8b2999f9345a22300b11e62..a4b75843376071ba402729f63e591c2e7bb0b7fe 100644 (file)
@@ -35,7 +35,7 @@ public class ControllerIO {
     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();
@@ -76,9 +76,8 @@ public class ControllerIO {
                                         serverSelectionKey);
                             }
                         }
-                    } catch (IOException e) {
-                        logger.error("Caught I/O Exception: " + e.toString());
-                        return;
+                    } catch (Exception e) {
+                        continue;
                     }
                 }
             }
@@ -87,13 +86,9 @@ public class ControllerIO {
         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();
     }
 }