NetworkServerAbstract: add getSocketAddress()
authorTJ <hacker@iam.tj>
Mon, 4 May 2015 15:24:41 +0000 (16:24 +0100)
committerTJ <hacker@iam.tj>
Mon, 4 May 2015 15:24:41 +0000 (16:24 +0100)
Supports easy access and passing around of the socket address of the
service.

src/uk/ac/ntu/n0521366/wsyd/libs/net/NetworkServerAbstract.java

index 4119a5c..c86c0c4 100644 (file)
@@ -207,6 +207,15 @@ public abstract class NetworkServerAbstract extends SwingWorker<Integer, Network
         this(socketAddress, title, serviceToHostMap, null);
     }
 
+    /**
+     * Get the socket in use - not that (possibly wildcard/ephermeral) requested.
+     * 
+     * @return the port being used
+     */
+    public WSYD_SocketAddress getSocketAddress() {
+        return _socketAddress;
+    }
+
     /**
      * Enable or disable simulated received packet injection.
      *