Author: toad
Date: 2007-11-17 22:20:12 +0000 (Sat, 17 Nov 2007)
New Revision: 15802

Modified:
   trunk/freenet/src/freenet/io/NetworkInterface.java
Log:
Patch from ET at mj+bSV4hxRMtCj9fcwy4Ww9_3mc preparatory to creating 
SSLNetworkInterface

Modified: trunk/freenet/src/freenet/io/NetworkInterface.java
===================================================================
--- trunk/freenet/src/freenet/io/NetworkInterface.java  2007-11-17 21:18:45 UTC 
(rev 15801)
+++ trunk/freenet/src/freenet/io/NetworkInterface.java  2007-11-17 22:20:12 UTC 
(rev 15802)
@@ -91,12 +91,16 @@
         * @param allowedHosts
         *            A comma-separated list of allowed addresses
         */
-       private NetworkInterface(int port, String allowedHosts, Executor 
executor) throws IOException {
+       protected NetworkInterface(int port, String allowedHosts, Executor 
executor) throws IOException {
                this.port = port;
                this.allowedHosts = new AllowedHosts(allowedHosts);
                this.executor = executor;
        }

+       protected ServerSocket createServerSocket() throws IOException {
+               return new ServerSocket();
+       }
+       
        /**
         * Sets the list of IP address this network interface binds to.
         * 
@@ -128,7 +132,7 @@
                }
                acceptors.clear();
                for (int serverSocketIndex = 0; serverSocketIndex < 
bindToTokenList.size(); serverSocketIndex++) {
-                       ServerSocket serverSocket = new ServerSocket();
+                       ServerSocket serverSocket = createServerSocket();
                         try {
                             serverSocket.bind(new InetSocketAddress((String) 
bindToTokenList.get(serverSocketIndex), port));
                         } catch (SocketException e) {


Reply via email to