Author: nextgens
Date: 2009-02-02 19:19:23 +0000 (Mon, 02 Feb 2009)
New Revision: 25472

Modified:
   trunk/freenet/src/freenet/io/NetworkInterface.java
   trunk/freenet/src/freenet/support/WouldBlockException.java
Log:
Same thing on NetworkInterface.accept() throwing SocketTimeoutExceptions

Modified: trunk/freenet/src/freenet/io/NetworkInterface.java
===================================================================
--- trunk/freenet/src/freenet/io/NetworkInterface.java  2009-02-02 18:54:00 UTC 
(rev 25471)
+++ trunk/freenet/src/freenet/io/NetworkInterface.java  2009-02-02 19:19:23 UTC 
(rev 25472)
@@ -47,6 +47,7 @@
 
        static {
                Logger.registerLogThresholdCallback(new LogThresholdCallback(){
+            @Override
                        public void shouldUpdate(){
                                logMINOR = Logger.shouldLog(Logger.MINOR, this);
                        }
@@ -77,6 +78,11 @@
        
        private final Executor executor;
 
+    // @see
+    // 
http://blogs.sun.com/jrose/entry/longjumps_considered_inexpensive?resubmit=damnit
+    // We don't want it to be final because we would like to know which 
subsystem it belongs to
+    private final SocketTimeoutException socketException =  new 
SocketTimeoutException();
+
        public static NetworkInterface create(int port, String bindTo, String 
allowedHosts, Executor executor, boolean ignoreUnbindableIP6) throws 
IOException {
                NetworkInterface iface = new NetworkInterface(port, 
allowedHosts, executor);
                try {
@@ -202,14 +208,14 @@
                synchronized (syncObject) {
                        while (acceptedSockets.size() == 0) {
                                if (acceptors.size() == 0) {
-                                       throw new SocketTimeoutException();
+                                       throw socketException;
                                }
                                try {
                                        syncObject.wait(timeout);
                                } catch (InterruptedException ie1) {
                                }
                                if ((timeout > 0) && (acceptedSockets.size() == 
0)) {
-                                       throw new SocketTimeoutException();
+                                       throw socketException;
                                }
                        }
                        return acceptedSockets.remove(0);

Modified: trunk/freenet/src/freenet/support/WouldBlockException.java
===================================================================
--- trunk/freenet/src/freenet/support/WouldBlockException.java  2009-02-02 
18:54:00 UTC (rev 25471)
+++ trunk/freenet/src/freenet/support/WouldBlockException.java  2009-02-02 
19:19:23 UTC (rev 25472)
@@ -30,6 +30,7 @@
 
     // Optimization :
     // 
http://blogs.sun.com/jrose/entry/longjumps_considered_inexpensive?resubmit=damnit
+    @Override
     public final synchronized Throwable fillInStackTrace() {
         if(logDEBUG)
             return super.fillInStackTrace();

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to